home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / New System Software Extensions / File System Manager SDK / File System Manager Docs / Guide - File System Manager / Guide - File System Manager
Encoding:
Text File  |  1994-09-06  |  652.9 KB  |  737 lines  |  [ONLN/HLX2]

  1. Guide to the File System Manager    ®
  2. Version 1.2
  3. September 6, 1994
  4.     Apple Computer, Inc.
  5. © 1994 Apple Computer, Inc.
  6. All rights reserved. 
  7. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, mechanical, electronic, photocopying, recording, or otherwise, without prior written permission of Apple Computer, Inc. Printed in the United States of America.
  8. No licenses, express or implied, are granted with respect to any of the technology described in this book. Apple retains all intellectual property rights associated with the technology described in this book. This book is intended to assist application developers to develop applications only for Apple Macintosh computers.
  9. Every effort has been made to ensure that the information in this manual is accurate. Apple is not responsible for printing or clerical errors.
  10. Apple Computer, Inc.
  11. 1 Infinite Loop
  12. Cupertino, CA 95014
  13. 408-996-1010
  14. Apple, the Apple logo, APDA, AppleLink, AppleShare, AppleTalk, A/UX, EtherTalk, LaserWriter, Macintosh, MPW, PowerBook, ProDOS, and TokenTalk are trademarks of Apple Computer, Inc., registered in the United States and other countries.
  15. Apple Desktop Bus, Apple SuperDrive, Balloon Help, Finder, ResEdit, Macintosh Quadra, PowerBook Duo, Power Macintosh, System 7, and QuickDraw, are trademarks of Apple Computer, Inc.
  16. Motorola is a registered trademark of Motorola Corporation.
  17. UNIX is a trademark of UNIX System Laboratories, Inc.
  18. Simultaneously published in the United States and Canada.
  19. LIMITED WARRANTY ON MEDIA AND REPLACEMENT
  20. ALL IMPLIED WARRANTIES ON THIS MANUAL, INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE LIMITED IN DURATION TO NINETY (90) DAYS FROM THE DATE OF THE ORIGINAL RETAIL PURCHASE OF THIS PRODUCT.
  21. Even though Apple has reviewed this manual, APPLE MAKES NO WARRANTY OR REPRESENTATION, EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THIS MANUAL, ITS QUALITY, ACCURACY, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. AS A RESULT, THIS MANUAL IS SOLD “AS IS,” AND YOU, THE PURCHASER, ARE ASSUMING THE ENTIRE RISK AS TO ITS QUALITY AND ACCURACY.
  22. IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT OR INACCURACY IN THIS MANUAL, even if advised of the possibility of such damages.
  23. THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLUSIVE AND IN LIEU OF ALL OTHERS, ORAL OR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer, agent, or employee is authorized to make any modification, extension, or addition to this warranty.
  24. Some states do not allow the exclusion or limitation of implied warranties or liability for incidental or consequential damages, so the above limitation or exclusion may not apply to you. This warranty gives you specific legal rights, and you may also have other rights which vary from state to state.
  25. 1    The File System Manager
  26. About this chapter
  27. This chapter describes foreign file systems and the File System Manager (FSM). It also provides a complete description of all FSM data types, FSM service routines available to a foreign file system and other programs, and the FSM component interfaces.
  28. About Foreign File Systems
  29. A foreign file system allows Macintosh applications to gain access to non-Macintosh volumes using File Manager routines. For example, a Macintosh application can use File Manager routines to read from and write to files on a ProDOS disk if there is a foreign file system for ProDOS.
  30. In the past, developing a foreign file system required extensive knowledge of the Macintosh File Manager and how it used both documented and undocumented low-memory global variables and data structures. To solve this problem, Apple has written the File System Manager. To create a new foreign file system, developers no longer need to access undocumented portions of the Macintosh and interface with the Macintosh file system through a 68000 register-based interface. Instead, they provide a foreign file system for a particular file system that works with the File System Manager. The File System Manager provides a systematic way for one or more foreign file systems to interact with the Macintosh file system using high-level language interface.
  31. The File System Manager performs low-level tasks common to all foreign file systems. It intercepts incoming file system related traps, identifies the foreign file system the request should be passed to, and then passes on only those requests requiring action by the particular foreign file system. To develop a foreign file system, you provide a set of foreign file system routines—described in the following chapters—that the File System Manager can call.
  32. Important Note: Even though the File System Manager provides many services that simplify development of foreign file systems, developing a foreign file system is both a difficult and time-consuming process. A minimal foreign file system must implement over forty Macintosh file system routines while a networked, sharable file system will have to implement as many as eighty Macintosh file system routines. To write a foreign file system you must be familiar with the low-level Macintosh file system data routines and data structures described in Inside Macintosh: Files and with the material covered in the chapters of the Guide to the File System Manager.
  33. About the File System Manager
  34. The File System Manager is the part of the Macintosh Operating System that manages the use of foreign file systems. The File System Manager provides a general means by which foreign file systems can be installed, identified, and interfaced to the Operating System .
  35. The Operating System services provided by the File System Manager are called FSM components and the interface mechanism between an foreign file system and a particular FSM component is known as a FSM component interface. At this time, two FSM component interface are defined for use under the File System Manager
  36. •    the HFS Component Interface which allows a foreign file system to process File Manager requests
  37. •    the Disk Initialization Package Component Interface which allows foreign file systems to initialize foreign file system volumes on a Macintosh
  38. For each installed file system, the File System Manager maintains a file system descriptor (FSD). Information in the FSD identifies the file system and describes its interfaces to the File System Manager and to the FSM component interfaces supplied by the File System Manager. Installed FSDs are kept in the File System Manager’s private FSD queue.
  39. A foreign file system’s FSD can be installed, accessed, maintained, and removed with the FSM service routines. FSM service routines also allow applications to communicate with the File System Manager and foreign file systems, and allow disk drivers and foreign file systems to communicate with the File System Manager
  40. Figure 1-1 shows how the Operating System and the File System Manager work together to allow applications to access foreign file systems.
  41. Figure 1-1.  Applications using foreign file systems through the File System Manager
  42.  
  43. Using the File System Manager
  44. This section describes
  45. •    File system descriptors (FSDs)
  46. •    FSM component interfaces
  47. •    how to determine if the File System Manager is available
  48. •    how foreign file systems are installed and enabled
  49. File System Descriptors
  50. The File System Manager maintains a file system descriptor (FSD) for each installed foreign file system. Information in the FSD identifies the file system and describes its interfaces to the FSM component interfaces supplied by the File System Manager.
  51. A foreign file system’s FSD is installed, accessed, maintained, and removed with the FSM service routines. FSDs are created with InstallFS. A copy of the information in an FSD can be obtained with GetFSInfo. Information in an FSD can be modified with SetFSInfo. An FSD can be removed with RemoveFS. The FSM service routines use the data type FSDRec.
  52. struct FSDRec {
  53. struct FSDRec    *fsdLink;    /* ptr to next */
  54. short    fsdLength;    /* length of this FSD in 
  55.                 bytes */
  56. short    fsdVersion;    /* version number */
  57. short    fileSystemFSID;    /* file system id */
  58. Str31    fileSystemName;    /* file system name */
  59. FSSpec    fileSystemSpec;    /* foreign file system's 
  60.                 FSSpec */
  61. Ptr    fileSystemGlobalsPtr;    /* ptr to file system 
  62.                 globals */
  63. FSDCommUPP    fileSystemCommProc;    /* communication proc with 
  64.                 the FFS */
  65. long    reserved3;    /* reserved, must be 0 */
  66. long    reserved2;    /* reserved, must be 0 */
  67. long    reserved1;    /* reserved, must be 0 */
  68. HFSCIRec    fsdHFSCI;    /* HFS component 
  69.                 interface */
  70. DICIRec    fsdDICI;    /* Disk Initialization 
  71.                 component interface */
  72. };
  73. typedef struct FSDRec FSDRec;
  74. typedef FSDRec *FSDRecPtr;
  75. Field descriptions
  76. fsdLink    A pointer to the next entry in the FSD list.
  77. fsdLength    The length of of this FSD in bytes.
  78. fsdVersion    The lowest version of the File System Manager this foreign file system can support. Currently, this is 1.
  79. fileSystemFSID    The unique file system ID (FSID) of the foreign file system. See “File System ID Numbers” on page 1-7 for more information about FSID numbers.
  80. fileSystemName    A Pascal string (Str31) which is used to identify the foreign file system. It is not guaranteed to be unique. fileSystemName is used by the Disk Initialization Package. The name is displayed in a dialog box that presents the user a choice of file system formats with which a disk may be initialized.
  81. fileSystemSpec    An FSSpec indicating the location of the foreign file system’s file code file. The File System Manager fills in fileSystemSpec with the location of the current resource file (CurResFile) when the FSD is installed by InstallFS.
  82. fileSystemGlobalsPtr    A pointer to the foreign file system’s optional global data area. It is passed to the foreign file system as a parameter for all FSM component interface requests to the foreign file system. A nil value indicates no global area was allocated. The global data area is allocated by the foreign file system installation code.
  83. fileSystemCommProc    A pointer to the foreign file system’s communications function.
  84. reserved3    Reserved. Must be zero.
  85. reserved2    Reserved. Must be zero.
  86. reserved1    Reserved. Must be zero.
  87. fsdHFSCI    The foreign file system’s HFS component interface record. See “The HFS Component Interface Record” in Chapter 2 for more information about the HFS component interface record.
  88. fsdDICI    The foreign file system’s Disk Initialization component interface record. See “The Disk Initialization Component Interface Record” in Chapter 4 for more information about the Disk Initialization component interface record.
  89. File System ID Numbers
  90. A file system ID (FSID) number is a unique word-length value that identifies a particular file system. This number is used by the Macintosh file system and by the File System Manager to identify a particular file system. The FSID value passed to InstallFS is checked by the File System Manager to insure that a FSD with that FSID is not already installed. The FSID is passed as a parameter to all File System Manager service routines. Table 1-1 is a list of file system IDs currently owned by Apple file systems.
  91. Table 1-1.    File System IDs owned by Apple file systems
  92. FSID    File System
  93. $0000    Macintosh HFS or MFS    
  94. $0100    ProDOS File System    
  95. $0101    PowerTalk Mail Enclosures    
  96. $4147    ISO 9660 File Access (through Foreign File Access)    
  97. $4242    High Sierra File Access (through Foreign File Access)    
  98. $464D    QuickTake File System (through Foreign File Access)    
  99. $4953    Macintosh PC Exchange (MS-DOS)    
  100. $4A48    Audio CD Access (through Foreign File Access)    
  101. $4D4B    Apple Photo Access (through Foreign File Access)    
  102.  
  103. FSID values between $0001 and $00FF are reserved for old-style foreign file systems that determine their FSID’s dynamically (i.e., by searching the drive queue) and cannot be used for File System Manager foreign file systems.
  104. FSID values between $0100 and $7FFF are reserved for the File System Manager and other foreign file systems that use registered file system ID numbers.
  105. FSID values $8000 and above are reserved for future use by Apple Computer, Inc.
  106. FSID values fsmIgnoreFSID ($FFFE) and fsmGenericFSID ($FFFF) have special meaning. fsmIgnoreFSID is stored in the partition map on a partitioned disk. It signals the disk driver not to install this partition into the drive queue. fsmGenericFSID is stored in the drive queue element (DrvQEl) by the disk driver to signal an unknown foreign file system volume. The File System Manager will attempt to find a foreign file system that can identify disks with the fsmGenericFSID by calling each foreign file system with the ffsIDVolMountMessage message. This allows disk drivers to support multiple volume formats without having to identify the volume format.
  107. To reserve a FSID in the File System Manager range ($0100 through $7FFF), a special creator type must be registered with Apple’s Developer Support Center (AppleLink: DEVSUPPORT). The high word of the creator type must be $0613. The low word of the creator type is the FSID to register. For example, to reserve the FSID $0100 for a foreign file system, the creator type $06130100 should be registered. The creator type registered for an FSID can also be used as the creator type of the system extension file that implements a foreign file system.
  108. Important: File System ID numbers in the File System Manager range were not registered before 1993. As a result, there are foreign file systems in use that have not registered with Apple’s Developer Support Center. If you are the publisher of one of those foreign file systems, please register your FSID immediately to help prevent file system ID conflicts.
  109. File System Communications Function
  110. The communications function pointed to by fileSystemCommProc in an FSDRec is used by the File System Manager to communicate with a foreign file system. When the file system communications function is called, it is passed a message and a pointer to a buffer containing any additional parameters needed to process the message. The currently defined messages are listed in Table 1-2.
  111. Table 1-2.    File System Communications Function Messages
  112. Message    Purpose
  113. ffsNopMessage    0    No operation. The file system communications function should simply return a result of noErr.    
  114. ffsGetIconMessage    1    Return disk icon and mask.    
  115. ffsIDDiskMessage    2    Identify the volume about to be mounted.    
  116. ffsLoadMessage    3    Load the foreign file system’s HFS component interface code and data.    
  117. ffsUnloadMessage    4    Unload the foreign file system’s HFS component interface code and data.    
  118. ffsIDVolMountMessage    5    Identify a VolMountInfo record by its media field.    
  119. ffsInformMessage    6    Foreign file system defined message.    
  120.  The file system communications function is described in detail later in this chapter.
  121. Global Data Area
  122. Unlike a Macintosh application, a foreign file system possesses no A5 world. Therefore, a foreign file system cannot define and use global variables. Instead, the File System Manager allows a foreign file system to allocate a global data area which is used to store data needed globally by the foreign file system.
  123. The global data area must be allocated in the system heap before the foreign file system is installed and the address of the global data area is stored in the foreign file system’s FSD. Every time the File System Manager calls a foreign file system function, the address of the global data area is passed to the foreign file system as one of the function parameters. This allows any part of a foreign file system to access the data in its global data area.
  124. FSM Component Interfaces
  125. The File System Manager supplies an interface mechanism known as an FSM component interface. An FSM component interface can be any functional interface exported by a given Macintosh operating system or toolbox component. Each FSM component interface is an independent interface, defined and managed by a particular Macintosh operating system or toolbox component. This includes the definition of the calls involved, the dispatching of calls to the foreign file systems, and the execution environment in which those calls operate.
  126. At this time, two FSM component interfaces are defined for use under the File System Manager
  127. •    the HFS Component Interface which allows a foreign file system to process File Manager requests
  128. •    the Disk Initialization Package Component Interface which allows foreign file systems to initialize foreign file system volumes on a Macintosh
  129. The FSD and the FSM component interface mechanism are both designed so that new FSM component interfaces can be added by Apple Computer to the File System Manager at a later time if needed.
  130. The connection between a given component and a foreign file system is defined by a FSM component interface record which is contained in a foreign file system’s FSD. A minimum FSM component interface record includes a dispatch mask which controls the use of the interface, and at least one pointer to the foreign file system code responsible for processing the requests from that component. Additional interface parameters other than the dispatch mask and code pointer may be included in a given FSM component interface. These are FSM component interface dependent parameters and are not required by the File System Manager. These parameters are later used by the individual operating system or toolbox components to dispatch their requests to the foreign file system.
  131. FSM Component Interface Dispatch Mask
  132. The first long word of an FSM component interface record is the FSM component interface dispatch mask (compInterfMask). The bits of the compInterfMask currently have these meanings:
  133. Bit    Name    Meaning
  134. 0-23        FSM component interface dependent flags. Each 
  135.         component is free to define these flag bits 
  136.         as needed.
  137. 24-29        Reserved for the File System Manager’s use.
  138. 30    fsmComponentBusyBit    If set, the FSM component interface is busy (i.e., 
  139.         one or more requests are outstanding). This bit is 
  140.         maintained by the component and used by the File 
  141.         System Manager to control the use of the 
  142.         SetFSInfo File System Manager service routine.
  143. 31    fsmComponentEnableBit    If set, the component may begin dispatching 
  144.         requests to the foreign file system. The foreign file 
  145.         system should set this bit with the SetFSInfo 
  146.         File System Manager service routine once it is 
  147.         ready to receive requests.
  148. FSM Component Interface Processing Function
  149. The second long word of an FSM component interface record is a pointer (compInterfProc) to the foreign file system code responsible for processing redirected operating system or toolbox requests. Which operating system or toolbox requests are redirected is part of the FSM component interface definition.
  150. FSM Component Interface Dispatching Conventions
  151. In order to insure some degree of uniformity across FSM component interfaces, the File System Manager imposes some common conventions for use by components when dispatching requests to a foreign file system. Those conventions are
  152. •    The global pointer (fileSystemGlobalsPtr) from the FSD record is passed to the foreign file system on all requests. The global pointer is needed to locate context information associated with the operation of the foreign file system.
  153. •    The FSM component interface should dispatch requests to a foreign file system only if the fsmComponentEnableBit flag in the FSM component interface dispatch mask is set.
  154. •    The FSM component interface will set the fsmComponentBusyBit flag in the target file system’s FSM component interface dispatch mask when the interface is dispatched and clear the flag when the request has completed. This will prohibit modification of FSM component interface parameters by SetFSInfo.
  155. Ensuring the File System Manager is Available
  156. You must ensure the File System Manager is available on the user’s computer before calling the File System Manager. You can determine is the File System Manager is available by using the Gestalt function. The Gestalt selector is gestaltFSAttr. The File System Manager is available if the Gestalt function returns a result of noErr and the gestaltHasFileSystemManager bit is set in the response parameter.
  157. In addition, you must ensure the File System Manager is version 1.2. Earlier versions of the File System Manager do not implement all of the interfaces described in this manual.
  158. Listing 1-1 illustrates how you use Gestalt to determine if the File System Manager is available and ensure that the File System Manager is version 1.2 or later.
  159. Listing 1-1.  Testing for the required version of the File System Manager
  160. static    Boolean    HasRequiredFSM(void)
  161. {
  162.     long    response;
  163.     Boolean    result;
  164.     
  165.     result = false;
  166.     /* Make sure the File System Manager is installed */
  167.     if ( Gestalt(gestaltFSAttr, &response) == noErr )
  168.     {
  169.         if ( (response & (1L << gestaltHasFileSystemManager)) != 0 )
  170.         {
  171.             /* We require File System Manager 1.1 features so */
  172.             /* check the version of FSM. */
  173.             if ( Gestalt(gestaltFSMVersion, &response) == noErr )
  174.             {
  175.                 /* Make sure we have File System Manager 1.2 or later */
  176.                 if ( (unsigned long)response >= 0x0120)
  177.                     result = true;
  178.             }
  179.         }
  180.     }
  181.     return ( result );
  182. }
  183. Installing and Enabling a Foreign File System
  184. Installation of foreign file systems will usually be accomplished by a system extension (INIT) file’s code at startup time. The mechanism that executes a system extension (commonly called the INIT 31 mechanism) is described in Chapter 29 “The System Resource File” in Inside Macintosh Volume IV, in Chapter 19 “The Start Manager” in Inside Macintosh Volume V, and in Inside Macintosh: Operating System Utilities. The INIT 31 mechanism will load and execute the foreign file system installation code in an 'INIT' resource in the foreign file system file.
  185. The installation can also be done from within an application if precautions are taken to ensure the foreign file system is installed in the system heap, or if installed in the application’s heap, that all volume are unmounted and the foreign file system removed before the application quits.
  186. If the File System Manager is available (see the section, Ensuring the File System Manager is Available) then the foreign file system installation code should install the foreign file system. To install a foreign file system, the foreign file system initialization code must allocate space for the global data area, load and detach the code resource for the FSM component interface processing function, initialize the fields of an FSDRec, and call InstallFS to add an FSD to the File System Manager’s FSD queue. If InstallFS is successful, the foreign file system is installed with its component interfaces disabled. Once the foreign file system is installed, the next step is to initialize the component interface records in the FSD to let the File System Manager know the features the foreign file system is capable of.
  187. All foreign file systems must support the HFS component interface. To initialize the HFSCIRec in the FSD, the installation code should set the hfsCIDoesDynamicLoadMask bit in the compInterfMask field of the HFSCIRec. The File System Manager will call the fsdCommProc function with a ffsLoadMessage when it needs the foreign file system’s HFS component interface code loaded.
  188. If the foreign file system supports the Disk Initialization component interface, then the installation code needs to load and detach the foreign file system’s disk initialization code and data, and then enable the Disk Initialization component interface in the FSD.
  189. If the foreign file system is successfully installed, the installation code should call InformFSM with a fsmDrvQElChangedMessage message to mount any volumes owned by the foreign file system that might already be in drives.
  190.  
  191. File System Manager Service Routines
  192. Six FSM service routines are provided by the File System Manager. These service routines let you install, access, maintain and remove the information in the FSDs, send the File System Manager messages, and send file system specific messages to a foreign file system. The FSM service routines are listed in Table 1-3.
  193. Table 1-3.    File System Manager Service Routines
  194. Name    Purpose
  195. InstallFS    Adds a new FSD to the File System Manager’s FSD queue.    
  196. RemoveFS    Removes a FSD from the File System Manager’s FSD queue.    
  197. GetFSInfo    Returns the FSD for a specific foreign file system or all foreign file systems.    
  198. SetFSInfo    Changes the FSD information of a foreign file system.    
  199. InformFSM    Sends messages or requests to the File System Manager.    
  200. InformFFS    Sends a file system specific message to a foreign file system.    
  201. All of the FSM service routines execute synchronously. GetFSInfo and SetFSInfo may be called at any time. InstallFS, RemoveFS, and InformFSM cannot be called by code executing at interrupt time — they may make Memory Manager requests that move memory, or synchronous operating system requests. Note that the File System Manager service routines are not Macintosh file system routines and are not controlled by the file system queuing mechanism.
  202. InstallFS
  203. Use the InstallFS function to add a new file system descriptor to the system.
  204. pascal short InstallFS (FSDRecPtr fsdPtr);
  205. fsdPtr    Contains a pointer to an FSDRec initialized with the data you want copied to the file system descriptor InstallFS creates in the FSD queue.
  206. fsdPtr record
  207. Æ    fsdLength    short    Contains the size of the FSDRec. 
  208.             Should always be sizeof(FSDRec).
  209. Æ    fsdVersion    short    Contains the minimum version of the 
  210.             File System Manager this foreign file 
  211.             system will work with. For the first 
  212.             release, use fsdVersion1.
  213. Æ    fileSystemFSID    short    Contains the unique file system ID 
  214.             (FSID) of the foreign file system.
  215. Æ    fileSystemName    Str31    Conatins a Pascal string which is used 
  216.             to identify the foreign file system by 
  217.             name.
  218. Æ    fileSystemGlobalsPtr    Ptr    Contains a pointer to the foreign file 
  219.             system’s optional global data area.
  220. Æ    fileSystemCommProc    FSDCommUPP    Contains a pointer to the foreign file 
  221.             system’s communications function.
  222. Æ    reserved3    long    Reserved field. Must be 0.
  223. Æ    reserved2    long    Reserved field. Must be 0.
  224. Æ    reserved1    long    Reserved field. Must be 0.
  225. Æ    fsdHFSCI    HFSCIRec    Contains the foreign file system’s HFS 
  226.             component interface record.
  227. Æ    fsdDICI    DICIRec    Contains the foreign file system’s Disk 
  228.             Initialization component interface 
  229.             record.
  230. The InstallFS function
  231. •    validates the FSDRec pointed to by fsdptr
  232. •    allocates a new file system descriptor
  233. •    copies the FSDRec pointed to by fsdptr to the new file system descriptor
  234. •    clears the fsdHFSCI and fsdDICI compInterfMask fields in the new file system descriptor
  235. •    initializes fileSystemSpec in the new file system descriptor to the location of the resource file referenced by CurResFile
  236. •    adds the new file system descriptor to the File System Manager’s FSD queue
  237. Note that the FSDRec passed by fsdptr is only copied by InstallFS. The FSDRec passed by fsdptr does not become part of the File System Manager’s FSD queue.
  238. Result codes
  239. noErr    0    No error
  240. fsmBadFFSNameErr    -433    length of fsdPtr->fileSystemName is 0 or 
  241.         greater than 31
  242. fsmBadFSDLenErr    -434    The file system descriptor is too large 
  243.         (fsdPtr->fsdLength is greater than 
  244.         sizeof(FSDRec))
  245. fsmDuplicateFSIDErr    -435    An FSD with fsdPtr->fileSystemFSID already 
  246.         exists in FSD queue
  247. fsmBadFSDVersionErr    -436    fsdPtr->fsdVersion is greater than the 
  248.         File System Manager version
  249. memFullErr    -108    The new file system descriptor could not be 
  250.         allocated
  251. RemoveFS
  252. Use the RemoveFS function to remove file system descriptor from the File System Manager’s FSD queue.
  253. pascal short RemoveFS (short fsid);
  254. fsid    Contains the unique file system ID (FSID) of the foreign file system.
  255. RemoveFS removes the FSD specified by fsid from the File System Manager’s FSD queue and deallocates the memory allocated by the File System Manager for the file system descriptor. The file system descriptor can be removed only if all volumes owned by the foreign file system are unmounted and all FSM component interfaces in the file system descriptor are not busy.
  256. Result codes
  257. noErr    0    No error
  258. fsmBusyFFSErr    -432    A volume with the fsid is mounted or an 
  259.         FSM component interfaces is busy
  260. fsmFFSNotFoundErr    -431    The file system descriptor with fsid was not 
  261.         found in the FSD queue
  262. GetFSInfo
  263. Use the GetFSInfo function to get a copy of a file system descriptor in the File System Manager’s FSD queue.
  264. pascal short GetFSInfo (short selector, short key, short *bufSize, 
  265.                         FSDRecPtr fsdptr);
  266. selector    Contains the method used to select the file system descriptor.
  267. key    Contains the key used to select the file system descriptor.
  268. bufSize    Contains a pointer to a short. On input, the field referred to by this parameter contains the size of the buffer pointed to by fsdPtr; on output, GetFSInfo places the number of bytes actually copied from the file system descriptor to the buffer into the field referred to by this parameter.
  269. fsdPtr    Contains pointer to a FSDRec. GetFSInfo copies the file system descriptor into the FSDRec referred to by this parameter.
  270. The GetFSInfo function returns a copy of an file system descriptor in the FSD queue. The GetFSInfo function selects the file system descriptor according to these rules:
  271. •    If selector is fsmGetFSInfoByIndex, GetFSInfo returns returns a copy of the file system descriptor whose position in the FSD queue is specified by the key parameter. A key of 0 returns a copy of the first file system descriptor in the FSD queue.
  272. •    If selector is fsmGetFSInfoByFSID, GetFSInfo returns returns a copy of the file system descriptor whose File System ID is specified by the key parameter.
  273. •    If selector is fsmGetFSInfoByRefNum, GetFSInfo returns returns a copy of the file system descriptor using the volume or file reference number specified by the key parameter. The key parameter must be a valid file or volume reference number and must be a file or volume owned by a foreign file system installed by the File System Manager.
  274. Result codes
  275. noErr    0    No error
  276. rfNumErr    -51    The key was an invalid reference number or 
  277.         referenced a volume not controlled by the 
  278.         File System Manager
  279. fsmFFSNotFoundErr    -431    The file system descriptor with the FSID, or at 
  280.         the specified index was not found in the 
  281.         FSD queue
  282. SetFSInfo
  283. Use the SetFSInfo function to change a file system descriptor in the File System Manager’s FSD queue.
  284. pascal short SetFSInfo (short fsid, short bufSize, FSDRecPtr fsdptr);
  285. fsid    Contains the unique file system ID (FSID) of the foreign file system.
  286. bufSize    Contains the size of the buffer pointed to by fsdPtr.
  287. fsdPtr    Contains a pointer to an FSDRec containing the data to be copied to the file system descriptor.
  288. SetFSInfo changes the file system descriptor specified by the fsid parameter. This routine is normally used following InstallFS to enable the foreign file system’s component interfaces. bufSize bytes are copied to the file system descriptor from the buffer pointed to by fsdPtr. The fsdLink, fsdLength, fsdVersion, fileSystemFSID, fileSystemName, and fileSystemSpec fields in the file system descriptor are not modified by SetFSInfo.
  289. Result codes
  290. noErr    0    No error
  291. fsmFFSNotFoundErr    -431    The file system descriptor with fsid was 
  292.         not found in the FSD queue
  293. fsmBusyFFSErr    -432    An FSM component interfaces is busy; the 
  294.         file system descriptor cannot be modified
  295. fsmBadFSDLenErr    -434    The number of bytes specified by bufSize is 
  296.         larger than the file system descriptor’s 
  297.         fsdLength field
  298. fsmNoAlternateStackErr    -437    An attempt was made to enable the file system’s
  299.         HFS component interface but no alternate stack 
  300.         was provided in fsdPtr->fsdHFSCI
  301. InformFSM
  302. Use the InformFSM function to communicate with the File System Manager.
  303. pascal short InformFSM (short theMessage, void *paramBlock);
  304. theMessage    Contains the message to send to the File System Manager.
  305. paramBlock    Contains a pointer to optional message specific data.
  306. InformFSM passes a message and optional message-specific data to the File System Manager. The File System Manager will return an fsmUnknownFSMMessageErr if an undefined message is passed. The currently defined messages are fsmNopMessage, fsmDrvQElChangedMessage, and fsmGetFSIconMessage. How the File System Manager handles each message and what result codes can be returned are described in the following paragraphs.
  307. fsmNopMessage (0)
  308. The File System Manager does nothing. The paramBlock parameter is ignored and the result is always noErr.
  309. Result codes
  310. noErr    0    No error
  311. fsmDrvQElChangedMessage (1)
  312. The fsmDrvQElChangedMessage tells the File System Manager to search the drive queue for unmounted volumes and attempt to find a File System Manager controlled foreign file system that can mount the volume. If a foreign file system is found that can mount the volume, the File System Manager will issue a diskInsertEvt for the drive so the foreign file system can mount the volume.
  313. Note: Drive queue elements with the value fsmIgnoreFSID in the dQFSID field are ignored by the File System Manager when it searches for unmounted volumes.
  314. This message can be sent by a disk driver to notify the File System Manager that a unmounted disk has a non-HFS partition. Before sending this message, the disk driver has allocated a drive queue element for the partition and added it to the system’s drive queue.
  315. This message is also sent by a foreign file system’s installation code to check for unmounted disks after a foreign file system is installed.
  316. The paramBlock parameter is ignored. The result is always noErr.
  317. Note: This message can cause memory to move. A disk driver can safely make this request only at driver accRun time.
  318. Result codes
  319. noErr    0    No error
  320. fsmGetFSIconMessage (2)
  321. The fsmGetFSIconMessage tells the File System Manager to get a foreign file system’s disk icon. The paramBlock parameter points to a FSMGetIconRec.
  322. FSMGetIconRec
  323. Æ    refNum    short    Contains the target drive number, volume 
  324.             reference number, or working directory 
  325.             number
  326. Æ    iconBufferPtr    Ptr    Contains a pointer to the icon buffer where the 
  327.             foreign file system will return the icon data
  328. Æ    requestSize    long    Contains the size of the supplied icon buffer
  329. ¨    actualSize    long    The foreign file system returns the actual size 
  330.             of the icon data in this field
  331. Æ    iconType    char    Contains the kind of icon requested
  332. ¨    isEjectable    Boolean    The File System Manager returns true in this 
  333.             field if the device is ejectable
  334. ¨    driveQElemPtr    DrvQElPtr    The File System Manager returns a pointer to 
  335.             the drive’s DrvQEl in this field
  336. ¨    fileSystemSpecPtr    FSSpecPtr    The File System Manager returns a pointer to 
  337.             foreign file system’s FSSpec in this field
  338. Æ    reserved1    long    reserved, must be zero
  339. The refNum field must contain the target drive number, volume reference number or working directory number. The iconBufferPtr field must point to the buffer where the icon will be returned. The requestSize field must contain the size of the supplied icon buffer. The iconType field must contain the kind of icon requested.
  340. The icon kinds supported and their sizes are those used by the Desktop Manager and are listed in Table 1-4.
  341. Table 1-4.    Icon Types
  342.     Value or 
  343.     bytes in    Corresponding 
  344. Constant    bitmap    resource type    Description
  345. kLargeIcon
  346. kLarge4BitIcon
  347. kLarge8BitIcon
  348. kSmallIcon
  349. kSmall4BitIcon
  350. kSmall8BitIcon    1
  351. 2
  352. 3
  353. 4
  354. 5
  355. 6    'ICN#'
  356. 'icl4'
  357. 'icl8'
  358. 'ics#'
  359. 'ics4'
  360. 'ics8'    Large black & white icon w/mask
  361. Large 4-bit color icon
  362. Large 8-bit color icon
  363. Small black-and-white icon w/mask
  364. Small 4-bit color icon
  365. Small 8-bit color icon    
  366. kLargeIconSize
  367. kLarge4BitIconSize
  368. kLarge8BitIconSize
  369. kSmallIconSize
  370. kSmall4BitIconSize
  371. kSmall8BitIconSize    256
  372. 512
  373. 1024
  374. 64
  375. 128
  376. 256    'ICN#'
  377. 'icl4'
  378. 'icl8'
  379. 'ics#'
  380. 'ics4'
  381. 'ics8'    Large black &white icon w/mask
  382. Large 4-bit color icon
  383. Large 8-bit color icon
  384. Small black-and-white icon w/mask
  385. Small 4-bit color icon
  386. Small 8-bit color icon    
  387. The File System Manager uses the refNum field in the FSMGetIconRec to determine the drive and the foreign file system that owns the drive. Then, the File System Manager fills in the isEjectable, driveQElemPtr, and fileSystemSpecPtr fields in the FSMGetIconRec and passes the FSMGetIconRec to the foreign file system with a ffsGetIconMessage message.
  388. The foreign file system is responsible for returning the icon in the buffer pointed to by iconBufferPtr and the icon data size in the actualSize field. See the description of the file system communications function’s ffsGetIconMessage for more information.
  389. Result codes
  390. noErr    0    No error
  391. nsvErr    -35    refNum in FSMGetIconRec did not specify 
  392.         a volume
  393. nsDrvErr    -56    refNum in FSMGetIconRec did not specify 
  394.         a drive
  395. afpItemNotFound    -5012    The foreign file system could not return the 
  396.         icon type requested
  397. any of the result codes returned by FSpOpenResFile
  398. InformFFS
  399. Use the InformFFS function to communicate with foreign file systems through the File System Manager.
  400. pascal short InformFFS(short fsid, void *paramBlock);
  401. fsid    Contains the unique file system ID (FSID) of the foreign file system.
  402. paramBlock    Contains a pointer to optional message specific data.
  403. InformFFS passes a message through the File System Manager to the foreign file system specified by fsid. The message data structure is defined by each foreign file system.
  404. Result codes
  405. noErr    0    No error
  406. fsmFFSNotFoundErr    -431    The file system descriptor with fsid was 
  407.         not found in the FSD queue
  408.  
  409. Foreign File System-Defined Routines
  410. File System Communications Function
  411. The communications function pointed to by fileSystemCommProc in an FSDRec is used by the File System Manager to communicate with a foreign file system. The fileSystemCommProc must have the following form.
  412. pascal OSErr MyFSDCommProc (short message, void *paramBlock, 
  413.                             void *globalsPtr);
  414. message    Contains the message being sent to the foreign file system.
  415. paramBlock    Contains a pointer to a buffer containing any additional parameters needed to process the message.
  416. globalsPtr    Contains a pointer to the foreign file system’s optional global data area.
  417. When the file system communications function is called, it is passed a message and a pointer to a buffer containing any additional parameters needed to process the message. The currently defined messages are ffsNopMessage, ffsGetIconMessage, ffsIDDiskMessage, ffsLoadMessage, ffsUnloadMessage, ffsIDVolMountMessage, and ffsInformMessage. How the file system communications function should handle each message and what result codes should be returned are described in the following paragraphs. If the message passed is not recognized or handled by your file system communications function, the function result returned must be fsmUnknownFSMMessageErr (-438).
  418. Note: The file system communications function is not called at interrupt time. Thus, it may make Memory Manager requests and synchronous operating system requests.
  419. ffsNopMessage (0)
  420. When the ffsNopMessage is passed to the file system communications function, do nothing and always return a result of noErr.
  421. Result codes
  422. noErr    0    No error
  423. ffsGetIconMessage (1)
  424. The ffsGetIconMessage is passed to the file system communications function when InformFSM is called with fsmGetFSIconMessage. The paramBlock parameter points to a FSMGetIconRec record.
  425. FSMGetIconRec
  426. Æ    refNum    short    Contains the target drive number, volume 
  427.             reference number, or working directory 
  428.             number
  429. Æ    iconBufferPtr    Ptr    Contains a pointer to the icon buffer where the 
  430.             foreign file system will return the icon data
  431. Æ    requestSize    long    Contains the size of the supplied icon buffer
  432. ¨    actualSize    long    The foreign file system returns the actual size 
  433.             of the icon data in this field
  434. Æ    iconType    char    Contains the kind of icon requested
  435. Æ    isEjectable    Boolean    Contains true if the device is ejectable
  436. Æ    driveQElemPtr    DrvQElPtr    Contains a pointer to the drive’s DrvQEl
  437. Æ    fileSystemSpecPtr    FSSpecPtr    Contains a pointer to foreign file system’s 
  438.             FSSpec
  439. Æ    reserved1    long    reserved, must be zero
  440. Your foreign file system uses iconType to determine the type of icon requested. If a known icon type is requested, open the foreign file system’s resource file (specified by fileSystemSpecPtr) with read-only access, get the specified icon resource, copy the icon data (up to requestSize bytes) into the buffer pointed to by iconBufferPtr, and then close the foreign file system’s resource file. Return the number of icon data bytes copied into into the buffer in the actualSize field.
  441. Result codes
  442. noErr    0    No error
  443. afpItemNotFound    -5012    The icon type requested could not be found
  444. any of the result codes returned by FSpOpenResFile
  445. ffsIDDiskMessage (2)
  446. The ffsIDDiskMessage is passed to the file system communications function when the File System Manager intercepts a MountVol request. If the idSector field in the foreign file system’s HFSCIRec is not -1, the paramBlock parameter points to the disk block specified by the idSector field of the HFSCIRec. If the idSector field in the foreign file system’s HFSCIRec is -1, the paramBlock parameter points to the parameter block used to make the MountVol request and the ioVRefNum field in that parameter block contains the drive number of the volume to mount.
  447. Your foreign file system should determine if the disk volume belongs to this foreign file system and return noErr if it does. If the disk volume cannot be identified, return extFSErr.
  448. If your foreign file system returns noErr and its HFS component interface code is not loaded, the File System Manager will send your foreign file system a ffsLoadMessage.
  449. Result codes
  450. noErr    0    The disk volume belongs to this foreign file 
  451.         system
  452. extFSErr    -58    The disk volume does not belong to this 
  453.         foreign file system
  454. ffsLoadMessage (3)
  455. The ffsLoadMessage is passed to the file system communications function when the File System Manager needs to call the HFS component interface code of a foreign file system that is not loaded. The paramBlock parameter is not used.
  456. You should check to see if the HFS component interface code is loaded. If not, load and detach the HFS component interface code and related data, allocate a stack for the HFS component interface code’s use, initialize the HFSCIRec in the FSD, set the hfsCIResourceLoadedBit in the compInterfMask, activate the HFS component interface for the foreign file system, and return noErr.
  457. If the HFS component interface code cannot be loaded, the stack cannot be allocated, or the HFS component interface for the foreign file system cannot be activated, return an error result.
  458. Result codes
  459. noErr    0    No error; the HFS component interface was 
  460.         successfully loaded and activated
  461. memFullErr    -108    The stack could not be allocated
  462. any of the result codes returned by the Resource Manager, GetFSInfo, or SetFSInfo
  463. ffsUnloadMessage (4)
  464. The ffsUnloadMessage is passed to the file system communications function when the File System Manager no longer needs the HFS component interface code in memory. The paramBlock parameter is not used.
  465. You should disable the HFS component interface, clear the hfsCIResourceLoadedBit in the compInterfMask, make the HFS component interface code and related data purgable, and dispose of the HFS component interface code’s stack.
  466. Result codes
  467. noErr    0    No error; the HFS component interface was 
  468.         successfully unloaded and deactivated
  469. any of the result codes returned by GetFSInfo, or SetFSInfo
  470. ffsIDVolMountMessage (5)
  471. This message is passed to the file system communications function when the File Manager’s VolumeMount routine is called to give a foreign file system a chance to claim the request. The paramBlock parameter points to parameter block used to make the VolumeMount request. The ioBuffer field of the parameter block points to a VolumeMountInfoHeader structure.
  472. VolumeMountInfoHeader
  473. Æ    length    short    Contains the length in bytes of the entire VolumeMountInfo 
  474.             record including this field and the variable length data 
  475.             following the flags field
  476. Æ    media    VolumeType    Contains the VolumeType of the media to mount. This is the 
  477.             creator type that you registered with Apple Computer, Inc. for 
  478.             your file system ID number.
  479. ´    flags    short    Contains the volume mount flags.
  480.             Æ    volMountInteractBit    If set, it’s safe for the file system to 
  481.                     perform user interaction to mount 
  482.                     the volume
  483.             ¨    volMountChangedBit    If set, the file system mounted the 
  484.                     volume, but the volume mounting 
  485.                     information record needs to be 
  486.                     updated.
  487. Note: The VolumeMountInfoHeader record is a superset of the VolMountInfoHeader record defined in Inside Macintosh: Files. In particular, the flags field used by the AppleShare file system was added to VolumeMountInfoHeader to allow foreign file systems to properly interact with the Alias Manager (the kARMNoUI rulesMask passed to MatchAlias is used to set or clear the volMountInteractBit; MatchAlias uses the volMountChangedBit to determine the value returned in the needsUpdate parameter).
  488. You should compare the media field in the VolumeMountInfoHeader to your foreign file system’s media type and return noEr if they match. If they do not match, return extFSErr. Your media type should be the creator type assigned when you register your foreign file system’s FSID.
  489. If your foreign file system returns noErr and its HFS component interface code is not loaded, the File System Manager will send your foreign file system a ffsLoadMessage.
  490. Foreign file systems are called with the ffsIDVolMountMessage before the VolumeMount request is passed to the File Manager. If your foreign file system claims the request, it should use this time to load data or code resources and to perform any user interaction needed to mount the volume. User interface interactions should be performed only  if the volMountInteract bit is set in the flags field. When the volMountInteract bit is set, it indicates the caller of VolumeMount has initialized the QuickDraw, the Font Manager, the Window Manager, the Menu Manager, TextEdit, and the Dialog Manager.
  491. If the volume can be mounted and the foreign file system detemines the volume mounting information record needs to be updated, the foriegn file system should set the volMountChangedBit to indicate to the caller that it should call GetVolMountInfoSize and GetVolMountInfo to get an updated version of the volume mounting information record.
  492. Note: When the foreign file system’s HFSCIProc is later called with the VolumeMount request, the foreign file system cannot call any system routines which might cause a File Manager request because the File Manager is single-threaded and not reentrant.
  493. Result codes
  494. noErr    0    The VolumeMount request belongs to this 
  495.         foreign file system
  496. extFSErr    -58    The VolumeMount request does not belong to 
  497.         this foreign file system
  498. ffsInformMessage (6)
  499. This message is passed to the file system communications function when InformFFS is called. The paramBlock parameter is the same paramBlock parameter passed to InformFFS.
  500. The ffsInformMessage allows other programs to pass your foreign file system messages defined by you.
  501. Result codes
  502. noErr    0    No error
  503. any result codes defined by your foreign file system for this request
  504. 2    The HFS Component Interface
  505. About this chapter
  506. This chapter describes the HFS component interface, the data structures used by the HFS component interface, and the routines your foreign file system must provide to the HFS component interface.
  507. To use this chapter, you should be familiar with the information in the chapters “The File System Manager” and “File System Utility Routines” in this document, the information in Inside Macintosh: Files, and the information in Inside Macintosh: Devices.
  508. About the HFS component interface
  509. The HFS component interface allows a foreign file system to process File Manager requests and allows a foreign file system to describe its file system services to the File System Manager. Whenever a File Manager request is made to a volume controlled by a foreign file system, the File System Manager will pass that request to the foreign file system through the HFS component interface.
  510. Using the HFS component interface
  511. This section describes
  512. •    the HFS Component Interface record
  513. •    the foreign file system’s stack
  514. •    the HFS Component Interface request processing function
  515. •    the Logical to Physical function
  516. •    the Extend File function
  517. The HFS Component Interface Record
  518. The HFS component interface record in an File System Descriptor lets the foreign file system tell the HFS component interface how to dispatch file system requests to the foreign file system. It tells the HFS component interface where the routines to handle file system requests are in memory, what disk block the foreign file system needs to identify a disk, and where the foreign file system’s stack is. The data type HFSCIRec defines the HFS component interface record.
  519. struct HFSCIRec {
  520. long    compInterfMask;    /* component flags */
  521. HFSCIUPP    compInterfProc;    /* pointer to file system 
  522.                 request processing code */
  523. Lg2PhysUPP    log2PhyProc;    /* pointer to Lg2PhysProc */
  524. Ptr    stackTop;    /* file system stack top */
  525. long    stackSize;    /* file system stack 
  526.                 size */
  527. Ptr    stackPtr;    /* current file system 
  528.                 stack pointer */
  529. long    reserved3;    /* --reserved, must be 
  530.                 zero-- */
  531. long    idSector;    /* Sector you need to ID a 
  532.                 local volume. For 
  533.                 networked volumes, this 
  534.                 should be -1. */
  535. long    reserved2;    /* --reserved, must be 
  536.                 zero-- */
  537. long    reserved1;    /* --reserved, must be 
  538.                 zero-- */
  539. };
  540. typedef struct HFSCIRec HFSCIRec;
  541. typedef HFSCIRec *HFSCIRecPtr;
  542. Field descriptions
  543. compInterfMask    Contains the HFS component interface dispatch mask. Currently the following bits are defined:
  544. Bit        Meaning
  545. 0-17        Reserved.
  546. 18    hfsCIHLL2PProcBit    Set this bit if the log2PhyProc is 
  547.         written in a high level language using 
  548.         Pascal calling conventions. Note: this 
  549.         bit should always be set by foreign 
  550.         file systems using the logical to 
  551.         physical interface described in this 
  552.         chapter.
  553. 19    hfsCIResourceLoadedBit    Set this bit if the HFSCIProc code 
  554.         resource is loaded. If the foreign 
  555.         file system doesn’t support dynamic 
  556.         loading, this bit should always be 
  557.         set.
  558. 20    hfsDoesDynamicLoadBit    Set this bit if dynamically loading 
  559.         code resource is supported.
  560. 21    hfsCIDoesDeskTopBit    Set this bit if Desktop Manager 
  561.         requests are supported. Obsolete, but 
  562.         should be set. Current versions of 
  563.         FSM always pass Desktop Manager 
  564.         requests on to foreign file systems.
  565. 22    hfsCIDoesAppleShareBit    Set this bit if AppleShare requests are 
  566.         supported. Obsolete, but should 
  567.         be set. Current versions of FSM 
  568.         always pass AppleShare requests on 
  569.         to foreign file systems.
  570. 23    hfsCIDoesHFSBit    Set this bit if HFS requests are 
  571.         supported. Obsolete, but should 
  572.         be set. Current versions of FSM 
  573.         always pass HFS requests on to 
  574.         foreign file systems.
  575. 24-29    Reserved for the File System 
  576.         Manager’s use.
  577. 30    fsmComponentBusyBit    If set, the FSM component interface 
  578.         is busy (i.e., one or more requests are 
  579.         outstanding). This bit is maintained 
  580.         by the component and used by the 
  581.         File System Manager to control the 
  582.         use of the SetFSInfo File System 
  583.         Manager service routine.
  584. 31    fsmComponentEnableBit    If set, the component may begin 
  585.         dispatching requests to the foreign file 
  586.         system. The foreign file system 
  587.         should set this bit with the 
  588.         SetFSInfo File System Manager 
  589.         service routine once it  is ready to 
  590.         receive requests.
  591. compInterfProc    Contains a pointer to the foreign file system’s HFS component interface request processing function .
  592. log2PhyProc    Contains a pointer to the foreign file system’s Logical to Physical routine.
  593. stackTop    Contains a pointer to the top of the foreign file systems’s stack. stackTop must be word aligned value since it becomes the stack pointer whenever the foreign file systems is called.
  594. stackSize    Contains the size of the foreign file systems’s stack.
  595. stackPtr    Reserved for future use by the File System Manager.
  596. reserved3    Reserved, must contain zero.
  597. idSector    Contains the sector the foreign file system needs to identify a local volume, or contains -1 if a network foreign file system. When the file system communications function is called with ffsIDDiskMessage and idSector is not -1, the paramBlock parameter points to the disk block specified. When the file system communications function is called with ffsIDDiskMessage and idSector is -1, the paramBlock parameter points to the parameter block used to make the MountVol request and the ioVRefNum field in that parameter block contains the drive number of the volume to mount.
  598. reserved2    Reserved, must contain zero.
  599. reserved1    Reserved, must contain zero.
  600. The Foreign File System’s Stack
  601. Each foreign file system must have its own alternate stack. The File System Manager’s HFS component interface saves the original application stack and switches to the foreign file system’s alternate stack before calling the foreign file system’s request processing function. After the foreign file system services the File Manager request, The File System Manager’s HFS component interface switches back to the original application stack.
  602. If the foreign file system performs I/O through the File System Utility cached I/O routines, there will be an additional stack switch while the HFS file system handles the I/O. Foreign file system Logical to Physical routines run on the foreign file system’s stack.
  603. The foreign file system’s alternate stack must be allocated in the system heap with NewPtrSys before the HFS component interface is activated. If the foreign file system supports dynamically loading code resources, the stack can be allocated when the file system communications function is called with the ffsLoadMessage and released when the file system communications function is called with the ffsUnloadMessage.
  604. The size of a foreign file system’s alternate stack should be the amount needed by your foreign file system plus two or three kilobytes of additional space for use by interrupt driven processes which may borrow space at interrupt time from your stack.
  605. The HFS Component Interface Request Processing Function
  606. The HFS Component Interface request processing function pointed to by compInterfProc in a HFSCIRec is called by the File System Manager to handle File Manager requests. The HFS Component Interface request processing function must have the following form.
  607. pascal OSErr HFSCIProc(VCBPtr theVCB, short selectCode, 
  608.                         void *paramBlock, void *fsdGlobalPtr, 
  609.                         short fsid);
  610. theVCB    Contains a pointer to the VCB of the volume that is the target of the file system request.
  611. selectCode    Contains either the A-Trap number or the HFSDispatch selector number which indicates what file system request was made.
  612. paramBlock    Contains a pointer to the parameter block passed to the file system request.
  613. fsdGlobalPtr    Contains a pointer to the foreign file system’s optional global data area.
  614. fsid    Contains the file system ID number of the volume.
  615. When a foreign file system’s HFSCIProc is called, it is told which volume (theVCB) is the target of the file system request (except for MountVol and VolumeMount as explained later in this section), what file system request was made, and is passed the parameter block used to make the file system request. The foreign file system should handle the request, fill in the appropriate fields in the parameter block, and return the appropriate result. The File System Manager provides File System Utility routines to your foreign file system to help it process file system request.
  616. s    Warning:  When the foreign file system’s HFSCIProc is called, the foreign file system cannot do anything which might cause another File Manager request because the File Manager is single-threaded and is not reentrant. If your foreign file system’s HFSCIProc does cause another File Manager request, the Macintosh system will deadlock. s
  617. The HFSCIProc is also passed a pointer to the foreign file system’s global data area and the file system ID number of the volume. The file system ID number allows a foreign file system that handles multiple file systems to quickly determine which file system needs to handle the file system request.
  618. Result codes
  619. noErr    0    The foreign file system handled the Macintosh 
  620.         file system request with no errors
  621. any of the result codes documented for a particular Macintosh file system request in Inside Macintosh: Files
  622. Listing 2-1 is an abbreviated example of a request processing function. Not all HFSDispatch selectors and Macintosh file system A-Traps are shown in this example.
  623. Listing 2-1.  HFS Component Interface request processing function
  624. /* Prototype for file system request handler routine */
  625. typedef OSErr (*hfsProcPtr)(VCBPtr theVCB, short selectCode, 
  626.                                         void *paramBlock, void *fsdGlobalPtr, 
  627.                                         short fsid);
  628.  
  629. pascal OSErr    HFSCIProc (VCBPtr theVCB, short selectCode, 
  630.                                     void *paramBlock, void *fsdGlobalPtr, 
  631.                                     short fsid)
  632. {
  633.     OSErr            result = extFSErr;
  634.     hfsProcPtr        hfsProc;
  635.     unsigned short    trapWord;
  636.     
  637.     /* selectCode contains the trap word or HFSDispatch selector */
  638.     /* Clear the trap attributes (i.e., async and immediate bits) */
  639.     trapWord = selectCode & 0xF0FF;
  640.     
  641.     /* and find out what to call with the big, big switch statement... */
  642.     switch (trapWord)
  643.     {
  644.         /* HFSDispatch (A260) file system selectors */
  645.         case kFSMOpenWD:
  646.             hfsProc = DoOpenWD;
  647.             break;
  648.         /*
  649.         ** The rest of HFSDispatch (A260) file system selectors go here.
  650.         */
  651.         case kFSMMakeFSSpec:
  652.             hfsProc = DoMakeFSSpec;
  653.             break;
  654.         
  655.         /* HFSDispatch (A260) Desktop Manager selectors */
  656.         case kFSMDTGetPath:
  657.             hfsProc = DoDTGetPath;
  658.             break;
  659.         /*
  660.         ** The rest of HFSDispatch (A260) Desktop Manager selectors 
  661.         ** go here.
  662.         */
  663.         case kFSMDTDelete:
  664.             hfsProc = DoDTDelete;
  665.             break;
  666.         
  667.         /* HFSDispatch (A260) AppleShare selectors */
  668.         case kFSMGetVolParms:
  669.             hfsProc = DoGetVolParms;
  670.             break;
  671.         /*
  672.         ** The rest of HFSDispatch (A260) AppleShare selectors 
  673.         ** go here.
  674.         */
  675.         case kFSMSetForeignPrivs:
  676.             hfsProc = DoSetForeignPrivs;
  677.             break;
  678.         
  679.         /* File system A-traps */
  680.         case kFSMOpen:
  681.             hfsProc = DoOpen;
  682.             break;
  683.         /*
  684.         ** The rest of File system A-traps go here.
  685.         */
  686.         case kFSMFlushFile:
  687.             hfsProc = DoFlushFile;
  688.             break;
  689.         
  690.         /* and if it wasn't there... */
  691.         default:
  692.             hfsProc = DoRequestNotSupported;
  693.             break;
  694.     }
  695.     
  696.     /* Call the appropriate file system request handler routine */
  697.     result = hfsProc(theVCB, selectCode, paramBlock, fsdGlobalPtr, fsid);
  698.     return(result);
  699. }
  700. Handling MountVol and VolumeMount requests
  701. There are two File Manager requests sent to a foreign file system’s HFSCIProc that may or may not be handled by your foreign file system, MountVol (selectCode = $A00F) and VolumeMount (selectCode = $0041). The File System Manager sends those requests to each installed foreign file system until one of the foreign file systems indicates that it has handled the request.
  702. If your foreign file system receives a MountVol request, it must determine if the disk volume belongs to it. You may be able to use the same code your foreign file system used to handle the ffsIDDiskMessage is passed to the file system communications function. If the volume is not your volume, you must return extFSErr. If the volume is your volume, you must return noErr if you successfully mount the volume, or one of the error result codes listed for PBMountVol in Inside Macintosh: Files.
  703. If your foreign file system receives a VolumeMount request and supports the VolumeMount related selectors (VolumeMount, GetVolMountInfoSize, and GetVolMountInfo), it should compare the media field in the VolumeMountInfoHeader to your foreign file system’s media type. If the media field does not match your media type, return extFSErr. If the media field matches your media type, you must return noErr if you successfully mount the volume, or one of the error result codes listed for PBVolumeMount in Inside Macintosh: Files. If your foreign file system does not support the VolumeMount related selectors, it should return paramErr.
  704. The Logical to Physical Block Mapping Function
  705. The Macintosh cache routines described in “File System Utility Routines” chapter can read or write either logical blocks of a file or physical blocks of a volume. However, because disk driver device requests always read or write physical blocks of a volume, a foreign file system must provide a routine to map logical file blocks to physical volume blocks. That routine is called the logical to physical routine. The address of the logical to physical routine is passed to the File System Manager in the log2PhyProc field of the foreign file system’s HFSCIRec and as a parameter to some cache routines. The logical to physical routine must have the following form.
  706. pascal OSErr Lg2PhysProc(void *fsdGlobalPtr,
  707.                         VCBPtr volCtrlBlockPtr,
  708.                         FCBRecPtr fileCtrlBlockPtr,
  709.                         short fileRefNum,
  710.                         unsigned long filePosition,
  711.                         unsigned long reqCount,
  712.                         unsigned long *volOffset,
  713.                         unsigned long *contiguousBytes);
  714. fsdGlobalPtr    Contains a pointer to the foreign file system’s optional global data area.
  715. volCtrlBlockPtr    Contains a pointer to the file’s Volume Control Block (VCB).
  716. fileCtrlBlockPtr    Contains a pointer to the file’s File Control Block (FCBRec) that is the target of the logical to physical mapping.
  717. fileRefNum    Contains the file’s reference number.
  718. filePosition    Contains the byte offset into the file’s data where the mapping should begin (always a multiple of 512 bytes).
  719. reqCount    Contains the number of bytes requested for the mapping operating (always a multiple of 512 bytes).
  720. volOffset    Contains a pointer to an unsigned long. Lg2PhysProc places the offset (in bytes) to the volume block where the file data can be found into the field referred to by this parameter. The value returned must be a multiple of 512 bytes.
  721. contiguousBytes    Contains a pointer to an unsigned long. Lg2PhysProc places the number of contiguous bytes which occur after the given offset, up to requestCount, into the field referred to by this parameter. The value returned must be a multiple of 512 bytes.
  722. It is the responsibility of the foreign file system to return an eofErr when a request for data is beyond the current logical end of file (before calling the Cache utility routines). It is the responsibility of the logical to physical routine to return an eofErr error when a cache routine asks for block mapping beyond the current physical end of file.
  723. Result codes
  724. noErr    0    Logical to physical mapping was successful
  725. eofErr    -39    Requested mapping was beyond the 
  726.         physical end of file
  727. ioErr    -36    Mapping failed because of an unexpected error
  728. Here is a brief description of how logical to physical mapping works. Assume that a file is open and that file occupies the physical blocks 101 through 103 and 105 through 109 (8 disk blocks) on the disk volume. The logical to physical routine needs to map bytes 0 through 1535 to blocks 101 through 103 and map bytes 1536 through 8191 to blocks 105 through 109. Here’s an example of how a logical to physical routine would perform the job of mapping a read to the fragmented file.
  729. A Read request is recieved through the HFSCIProc asking for 3072 bytes starting at offset 0 in the file. The HFSCIProc calls the file system’s Read request hander routine which eventually calls UTCacheReadIP to read the data from the file. The first time UTCacheReadIP is called, the Macintosh cache mechanism calls your logical to physical routine with filePosition = 0 and reqCount = 3072. The logical to physical routine returns 51712 in volOffset (the byte offset of block 101) and 1536 in contiguousBytes (the number of contiguous bytes starting at offset 51712 ). The Macintosh cache mechanism will then read 1536 bytes starting at offset 51200 into the buffer passed to UTCacheReadIP.
  730. Since the Read request hasn’t been satisfied, the file system’s Read request hander routine updates the buffer pointer and calls UTCacheReadIP again - this time asking for 1536 bytes starting at offset 1536 in the file. The Macintosh cache mechanism calls your logical to physical routine with filePosition = 1536 and reqCount = 1536. The logical to physical routine returns 53760 in volOffset (the byte offset of block 105) and 1536 in contiguousBytes (the number of contiguous bytes starting at offset 53760 ). The Macintosh cache mechanism will then read 1536 bytes starting at offset 53760 into the buffer passed to UTCacheReadIP and the Read request is complete.
  731.  
  732. 3    The File System Utility Routines
  733. About this chapter
  734. This chapter describes the utility routines provided by the File System Manager to your foreign file system to help it process Macintosh file system calls and describes the data structures used by the Macintosh file system.
  735. To use this chapter, you should be familiar with the information in the chapter “The HFS Component Interface” in this document, the information in Inside Macintosh: Files, and the information in Inside Macintosh: Devices.
  736. About File System Utility Routines 
  737. The File System Utility routines are intended for use by foreign file systems to allow your foreign file system to
  738. •    access file control blocks (FCBs), volume control blocks (VCBs), working directory control blocks (WDCBs), and drive queue elements (DrvQEl)
  739. •    set and get the default volume and working directory
  740. •    eject a volume
  741. •    validate and process parameters passed with Macintosh file system calls
  742. •    access the Macintosh file system’s cache buffers and low-level I/O services
  743. s    Warning:  File System Utility routines that can cause I/O through the Macintosh file system’s cache, UTGetBlock, UTReleaseBlock, UTFlushCache, UTCacheReadIP, and UTCacheWriteIP, must be called from a foreign file system handling a request through its HFSCIProc. Attempts to call those routines outside of the context of the HFSCIProc will cause a system crash. s
  744. Macintosh File System Data Structures
  745. This section describes the data structures used internally by the Macintosh file system. Foreign file systems need to access and manipulate these data strutures when handling calls from the HFS component interface.
  746. The data structures include
  747. •    volume control blocks (VCBs)
  748. •    file control blocks (FCBs)
  749. •    working directory control blocks (WDCBs)
  750. •    drive queue elements (DrvQEl)
  751. The data structures (except for working directory control blocks) and their use are described in Inside Macintosh: Files. The following sections describe how foreign file systems should use them.
  752. Volume Control Blocks
  753. Each time a volume is mounted, a foreign file system must allocate a volume control block (VCB) with UTAllocateVCB, read the volume and use the information to initialize the fields in the new VCB, and add the VCB to the VCB queue with UTAddNewVCB (unless an ejected or offline volume is being remounted). When a volume is unmounted, its VCB is removed from the VCB queue UTDisposeVCB.
  754. The volume control block queue is a standard Operating System queue maintained in the system heap. It contains a volume control block for each mounted volume. A volume control block is a nonrelocatable block that contains volume-specific information. If your foreign file system needs to keep additional information beyond that kept in the system VCB structure, you can allocate additional memory with UTAllocateVCB for your extended VCB structure. The structure of a system volume control block is defined by the VCB data type.
  755. struct VCB {        /*    volume control block */
  756. QElemPtr    qLink;    /*    next queue entry */
  757. short    qType;    /*    queue type */
  758. short    vcbFlags;    /*    volume flags */
  759. unsigned short    vcbSigWord;    /*    volume signature */
  760. unsigned long    vcbCrDate;    /*    date and time of volume 
  761.                 creation */
  762. unsigned long    vcbLsMod;    /*    date and time of last 
  763.                 modification
  764. short    vcbAtrb;    /*    volume attributes */
  765. unsigned short    vcbNmFls;    /*    number of files in root 
  766.                 directory */
  767. short    vcbVBMSt;    /*    first block of volume 
  768.                 bitmap */
  769. short    vcbAllocPtr;    /*    start of next allocation 
  770.                 search */
  771. unsigned short    vcbNmAlBlks;    /*    number of allocation blocks 
  772.                 in volume */
  773. unsigned long    vcbAlBlkSiz;    /*    size (in bytes) of 
  774.                 allocation blocks
  775. unsigned long    vcbClpSiz;    /*    default clump size */
  776. short    vcbAlBlSt;    /*    first allocation block in 
  777.                 volume */
  778. long    vcbNxtCNID;    /*    next unused catalog node 
  779.                 ID */
  780. unsigned short    vcbFreeBks;    /*    number of unused allocation 
  781.                 blocks */
  782. Str27    vcbVN;    /*    volume name */
  783. short    vcbDrvNum;    /*    drive number */
  784. short    vcbDRefNum;    /*    driver reference number */
  785. short    vcbFSID;    /*    file-system identifier */
  786. short    vcbVRefNum;    /*    volume reference number */
  787. Ptr    vcbMAdr;    /*    used internally */
  788. Ptr    vcbBufAdr;    /*    used internally */
  789. short    vcbMLen;    /*    used internally */
  790. short    vcbDirIndex;    /*    used internally */
  791. short    vcbDirBlk;    /*    used internally */
  792. unsigned long    vcbVolBkUp;    /*    date and time of last 
  793.                 backup */
  794. unsigned short    vcbVSeqNum;    /*    volume backup sequence 
  795.                 number */
  796. long    vcbWrCnt;    /*    volume write count */
  797. long    vcbXTClpSiz;    /*    clump size for extents 
  798.                 overflow file */
  799. long    vcbCTClpSiz;    /*    clump size for catalog 
  800.                 file */
  801. unsigned short    vcbNmRtDirs;    /*    number of directories in 
  802.                 root dir */
  803. long    vcbFilCnt;    /*    number of files in 
  804.                 volume */
  805. long    vcbDirCnt;    /*    number of directories in 
  806.                 volume */
  807. long    vcbFndrInfo[8];    /*    information used by the 
  808.                 Finder */
  809. unsigned short    vcbVCSize;    /*    used internally */
  810. unsigned short    vcbVBMCSiz;    /*    used internally */
  811. unsigned short    vcbCtlCSiz;    /*    used internally */
  812. unsigned short    vcbXTAlBlks;    /*    size of extents overflow 
  813.                 file */
  814. unsigned short    vcbCTAlBlks;    /*    size of catalog file */
  815. short    vcbXTRef;    /*    ref. num. for extents 
  816.                 overflow file */
  817. short    vcbCTRef;    /*    ref. num. for catalog 
  818.                 file */
  819. Ptr    vcbCtlBuf;    /*    ptr. to extents and catalog 
  820.                 caches */
  821. long    vcbDirIDM;    /*    directory last searched */
  822. short    vcbOffsM;    /*    offspring index at last 
  823.                 search */
  824. };
  825. typedef struct VCB VCB;
  826. typedef VCB *VCBPtr;
  827. Field descriptions
  828. qLink    A pointer to the next entry in the VCB queue. This field is initialized when the VCB is added to the VCB queue by UTAddNewVCB.
  829. qType    The queue type. This field is initialized when the VCB is added to the VCB queue by UTAddNewVCB.
  830. vcbFlags    Volume flags. Set bit 15 if the volume information has been changed by a File Manager call since the volume was last affected by a FlushVol call.
  831. vcbSigWord    The volume signature. This field must be set to $4244.
  832. vcbCrDate    Set to the date and time of volume creation (initialization), specified as the number of seconds since midnight, January 1, 1904.
  833. vcbLsMod    Set to the date and time of last modification, specified as the number of seconds since midnight, January 1, 1904. This is not necessarily when the volume was last flushed.
  834. vcbAtrb    Volume attributes. The bits have these meanings:
  835. Bit    Meaning
  836. 0–5    Reserved.
  837. 6    Set this bit if the volume is busy (one or more files are
  838.     open).
  839. 7    Set this bit if the volume is locked by hardware. This can 
  840.     be obtained when the volume is mounted with the 
  841.     DriveStatus function.
  842. 8–14    Reserved.
  843. 15    Set this bit if the volume is locked by software. This bit 
  844.     can be set or cleared by programs calling your foreign 
  845.     file system with _SetVInfo and you should store it 
  846.     between volume mounts.
  847. vcbNmFls    Set to the number of files in the volume’s root directory.
  848. vcbVBMSt    For HFS volumes, this field is used to point to the first block of the volume bitmap. Your foreign file system can use this field to point to an analogous structure. If it doesn’t, the field’s value must be 0.
  849. vcbAllocPtr    For HFS volumes, this field is used to point to the start block of the next allocation search. Your foreign file system can use this field for a similar purpose. If it doesn’t, the field’s value must be 0.
  850. vcbNmAlBlks    Set to the number of allocation blocks in the volume (maximum $FFFF).This field, together with the vcbAlBlkSiz field, is used to determine the number of bytes on a particular volume.  It must be initialized to a value which when multiplied with vcbAlBlkSiz provides a reasonable estimate of the size of the disk.
  851. vcbAlBlkSiz    Set to the allocation block size (in bytes). This field, together with the vcbNmAlBlks field, is used by the Finder and other applications to determine the number of bytes on a particular volume.  It must be initialized to some non-zero multiple of 512.
  852. vcbClpSiz    Set to the default clump size. For HFS volumes, this field is used to determine how many new allocation blocks to allocate when the file is extended. Your foreign file system can use this field for the same purpose, but in any case, it must set its value to a multiple of vcbAlBlkSiz or 0.
  853. vcbAlBlSt    Set to the first allocation block in the volume. For HFS volumes, this is the number of the first block used for files. If your foreign file system has an analogous structure (that is, if its header blocks are followed by a contiguous set of blocks for files), it can use this field in the same way. If not, it must leave this field zero.
  854. vcbNxtCNID    The next unused catalog node ID (directory ID or file ID). For HFS volumes, this is set to fsUsrCNID when the volume is initialized. When a new directory or file is created, vcbNxtCNID is used as the directory ID or file ID and then incremented. Your foreign file system can use this field for the same purpose, or may leave it zero.
  855. vcbFreeBks    Set to the number of unused allocation blocks on the volume (maximum $FFFF). This field, together with vcbAlBlkSiz, is used by the Finder and other applications to determine the number of free bytes in the volume. It must be initialized to a value which when multiplied with vcbAlBlkSiz provides a reasonable estimate of the free space in the volume.
  856. vcbVN    Set to the volume name. This field consists of a length byte followed by 27 bytes. Note that the volume name can occupy at most 27 characters; this is an exception to the normal file and directory name limit of 31 characters. The volume name must conform to the rules for HFS volumes (i.e., no colon characters). For file systems that have no volume-naming conventions, some standard name (such as “Untitled”) must be provided.
  857. vcbDrvNum    The drive number of the drive on which the volume is located. This field is initialized when the VCB is added to the VCB queue by UTAddNewVCB. When a mounted volume is placed offline or ejected, vcbDrvNum is set to 0.
  858. vcbDRefNum    The driver reference number of the driver used to access the volume. This field is initialized when the VCB is added to the VCB queue by UTAddNewVCB. When a volume is ejected, vcbDRefNum is set to the previous value of vcbDrvNum (and hence is a positive number). When a volume is placed offline, vcbDRefNum is set to the negative of the previous value of vcbDrvNum (and hence is a negative number).
  859. vcbFSID    An identifier for the file system handling the volume; it is zero for volumes handled by the File Manager and nonzero for volumes handled by other file systems. Set to your foreign file system’s file system ID.
  860. vcbVRefNum    The volume reference number. This field is initialized when the VCB is added to the VCB queue by UTAddNewVCB.
  861. vcbMAdr    Used internally. Reserved.
  862. vcbBufAdr    Used internally. Reserved.
  863. vcbMLen    Used internally. Reserved.
  864. vcbDirIndex    Used internally. Reserved.
  865. vcbDirBlk    Used internally. Reserved.
  866. vcbVolBkUp    Set to the date and time of the last volume backup, specified as the number of seconds since midnight, January 1, 1904.
  867. vcbVSeqNum    Used internally. Reserved.
  868. vcbWrCnt    The volume write count. This field is incremented every time the volume is written to by the Macintosh file system’s cache. If your foreign file system uses the Macintosh file system’s cache, it must either initialize this field to zero when a volume is mounted, or it must initialize this field to zero the first time the volume is mounted and then save the current value of this field when a volume is unmounted and restore the value when the volume is mounted again to keep a running count of writes to the volume.
  869. vcbXTClpSiz    The clump size of the extents overflow file. Reserved.
  870. vcbCTClpSiz    The clump size of the catalog file. Reserved.
  871. vcbNmRtDirs    Set to the number of directories in the root directory or leave it zero.
  872. vcbFilCnt    Set to the number of files on the volume or leave it zero.
  873. vcbDirCnt    Set to the number of directories on the volume (not including the root directory) or leave it zero.
  874. vcbFndrInfo    Information used by the Finder. For HFS volumes, this field is used internally by HFS. Leave it all zeroes until set by _SetVInfo.
  875. vcbVCSize    Used internally. Reserved.
  876. vcbVBMCSiz    Used internally. Reserved.
  877. vcbCtlCSiz    Used internally. Reserved.
  878. vcbXTAlBks    The size (in blocks) of the extents overflow file. Reserved.
  879. vcbCTAlBks    The size (in blocks) of the catalog file. Reserved.
  880. vcbXTRef    The path reference number for the extents overflow file. Reserved.
  881. vcbCTRef    The path reference number for the catalog file. Reserved.
  882. vcbCtlBuf    A pointer to the extents and catalog caches. Reserved.
  883. vcbDirIDM    The directory last searched. For HFS volumes, this field is used internally by HFS to optimize GetCatInfo and GetFInfo. Your foreign file system can use this field for the same purpose, or may leave it zero.
  884. vcbOffsM    The offspring index at the last search. For HFS volumes, this field is used internally by HFS to optimize GetCatInfo and GetFInfo. Your foreign file system can use this field for the same purpose, or may leave it zero.
  885. There are also three File System Utility routines that let you search the VCB queue
  886. •    UTLocateVCBByRefNum searches for the VCB using a working directory number, volume reference number, or drive number
  887. •    UTLocateVCBByName searches for the first VCB with a volume name
  888. •    UTLocateNextVCB searches the VCB queue for the next VCB with the volume name passed to UTLocateVCBByName (the Macintosh file system allows multiple mounted volumes to have the same volume name)
  889. Maximum Volume and File Sizes
  890. The maximum volume size supported by the current File Manager programming interface is slightly less than 4 Gigabytes. The exact number is the maximum allocation block size ($FE00) multiplied by the maximum number of allocation blocks ($FFFF) — that’s $FDFF0200 or 4261347840 decimal. To access volumes 2 Gigabytes or larger (larger than $7FFFFFFF or 2147483647 decimal), your foreign file system must used unsigned longword values when determining volume offsets and disk drivers called by your foreign file system must assume that the position passed to Read and Write requests in ioPosOffset is an unsigned longword value.
  891. However, many applications, including versions of the Macintosh Finder, use signed longword values when determining volume size and volume freespace. Because of this, volumes 2 Gigabytes or larger may cause unexpected behavior.
  892. Starting with System 7.5, the Macintosh Finder has been changed to use unsigned longword values when determining volume size and volume freespace. The File Manager routine PBHGetVInfo has also been changed starting with System 7.5 to pin the number of allocation blocks (vcbNmAlBlks) and the number of free allocation blocks (vcbNmAlBlks) so that when multiplied by the allocation block size (vcbAlBlkSiz), the result will be less than 2 Gigabytes. This prevents unexpected behavior from other applications that use signed longwords when determining volume size and volume freespace. The values in the VCB fields vcbNmAlBlks and vcbNmAlBlks are not changed. Listing 3-1 illustrates how you use Gestalt to determine if 4 Gigabyte volumes are supported by the Macintosh operating system.
  893. Listing 3-1.  Testing for 4 Gigabyte volume support
  894. Boolean    Has4GBVols(void)
  895. {
  896.     long response;
  897.     
  898.     if (Gestalt(gestaltFSAttr, &response) == noErr)
  899.         return ((response & (1L << gestaltFSSupports4GBVols)) != 0);
  900.     else
  901.         return (false);
  902. }
  903. The maximum file size supported by the current File Manager programming interface is 2 Gigabytes - 1 byte ($7FFFFFFF or 2147483647 decimal) because File Manger Read and Write requests use ioPosOffset as a signed longword value.
  904. File Control Blocks
  905. Each time a file is opened on a volume owned by a foreign file system, the foreign file system must read that file’s catalog entry and build a file control block (FCB) in the FCB array. A new FCB is obtained with the UTAllocateFCB function.
  906. When a file is closed, the foreign file system must mark the FCB free and release it with the UTReleaseFCB function.
  907. The structure of a file control block is defined by the FCBRec data type.
  908. struct FCBRec {
  909. unsigned long    fcbFlNm;    /* FCB file number. Non-zero 
  910.                 marks FCB used */
  911. SignedByte    fcbFlags;    /* FCB flags */
  912. SignedByte    fcbTypByt;    /* File type byte */
  913. unsigned short    fcbSBlk;     /* File start block (in 
  914.                 allocation size blocks) */
  915. unsigned long    fcbEOF;    /* Logical length or EOF in 
  916.                 bytes */
  917. unsigned long    fcbPLen;    /* Physical file length in 
  918.                 bytes */
  919. unsigned long    fcbCrPs;    /* Current position within 
  920.                 file */
  921. VCBPtr    fcbVPtr;    /* Pointer to the 
  922.                 corresponding VCB */
  923. Ptr    fcbBfAdr;    /* File's buffer address */
  924. unsigned short    fcbFlPos;    /* Directory block this file 
  925.                 is in */
  926. unsigned long    fcbClmpSize;    /* Number of bytes per 
  927.                 clump */
  928. Ptr    fcbBTCBPtr;    /* Pointer to B*-Tree control 
  929.                 block for this file */
  930. unsigned long    fcbExtRec[3];    /* First 3 file extents */
  931. OSType    fcbFType;    /* File's 4 Finder Type 
  932.                 bytes */
  933. unsigned long    fcbCatPos;    /* Catalog hint for use on 
  934.                 Close */
  935. unsigned long    fcbDirID;    /* Parent Directory ID */
  936. Str31    fcbCName;    /* CName of open file */
  937. };
  938. typedef struct FCBRec FCBRec;
  939. typedef FCBRec *FCBRecPtr;
  940. Field descriptions
  941. fcbFlNum    Set to the file ID of this file. File numbers less than fsUsrCNID are considered system files.
  942. fcbFlags    Flags describing the status of the file. Currently the following bits are defined:
  943. Bit        Meaning
  944. 0    fcbWriteBit    Set if data can be written to the file
  945. 1    fcbResourceBit    Set if this FCB describes a resource fork
  946. 2    fcbWriteLockedBit    Set if the file has a locked byte range
  947. 3        Reserved
  948. 4    fcbSharedWriteBit    Set if the file has shared write 
  949.         permissions
  950. 5    fcbFileLockedBit    Set if the file is locked (write-protected)
  951. 6    fcbOwnClumpBit    Set if the file’s clump size is specified in 
  952.         the FCB
  953. 7    fcbModifiedBit    Set if the file has changed since it was last 
  954.         flushed
  955. fcbSBlk    Used internally for volumes owned by the Macintosh file system. Your foreign file system can use this field for its own purposes.
  956. fcbEOF    Set to the logical end-of-file of the file.
  957. fcbPLen    Set to the physical end-of-file of the file.
  958. fcbCrPs    Set to the position of the mark.
  959. fcbVPtr    Set to point to the volume control block of the volume containing the file.
  960. fcbBfAdr    Reserved for internal use by the file system.
  961. fcbFlPos    Used internally for volumes owned by the Macintosh file system. Your foreign file system can use this field for its own purposes.
  962. fcbClmpSize    Set to the clump size of the file.
  963. fcbBTCBPtr    Reserved for internal use by the file system.
  964. fcbExtRec    For HFS volumes, this is an extent record (12 bytes) containing the first three extents of the file. Your foreign file system can use this field for its own purposes.
  965. fcbFType    Set to the file’s Finder type.
  966. fcbCatPos    For HFS volumes, a catalog hint, used when the file is closed. Your foreign file system can use this field for its own purposes.
  967. fcbDirID    The file’s parent directory ID number.
  968. fcbCName    The file’s name. This field consists of a length byte followed by 31 bytes. The file name must conform to the rules for HFS file names (i.e., no colon characters). For file systems that have no file-naming conventions, some standard name (such as “Untitled”) must be provided.
  969. There are also four File System Utility routines that let you search the FCB array
  970. •    UTLocateFCB lets you find a FCB on a particular volume by file number or by file name
  971. •    UTLocateNextFCB resumes searching for a FCB by file number or file name from the FCB found by UTLocateFCB (the same file can have multiple access paths)
  972. •    UTIndexFCB lets you find, one at a time, all of the FCBs on a particular volume
  973. •    UTResolveFCB returns a pointer to a FCBRec given a file reference number
  974. Note: If your foreign file system attempts to allocate a FCB in response to an _Open call and UTAllocateFCB cannot find a free FCB in the FCB array, you should return the tmfoErr result from UTAllocateFCB as your result. The Macintosh file system will then attempt to enlarge the FCB array and if successful, will retry the _Open call.  Because enlarging the FCB array will change the array’s location in memory, you should never save the location of a FCBRec between calls to your foreign file system. A FCBRecPtr can only be used within the context of one file system operation.
  975. Working Directory Control Blocks
  976. Working directories allow applications that use the old MFS File Manager routines to work on volumes with directory trees. Working directories allow the use of a volume reference number to specify both a volume and a directory on the volume. Each time a working directory is opened on a volume owned by a foreign file system, the foreign file system must build a working directory control block (WDCB) in the WDCB array with the UTAllocateWDCB function.
  977. When a working directory is closed, the foreign file system must mark the WDCB free and release it with the UTReleaseWDCB function. When a volume is unmounted and its VCB is disposed of, UTDisposeVCB closes all working directories open on the volume.
  978. The structure of a working directory control block is defined by the WDCBRec data type.
  979. struct WDCBRec {
  980. VCBPtr    wdVCBPtr;    /* Pointer to VCB of this 
  981.                 working directory */
  982. long    wdDirID;    /* Directory ID number of this 
  983.                 working directory */
  984. long    wdCatHint;    /* Hint for finding this 
  985.                 working directory */
  986. long    wdProcID;    /* Process that created this 
  987.                 working directory */
  988. };
  989. typedef struct WDCBRec WDCBRec;
  990. typedef WDCBRec *WDCBRecPtr;
  991. Field descriptions
  992. wdVCBPtr    A pointer to the VCB of the volume this working directory refers to.
  993. wdDirID    The directory ID number of the directory this working directory refers to.
  994. wdCatHint    The Macintosh file system stores a hint so it can quickly find the directory the working directory refers to. Your foreign file system can use this field for its own purposes.
  995. wdProcID    The process ID number passed to the OpenWD request.
  996. The File System Utility routine UTResolveWDCB lets you search the WDCB array. UTResolveWDCB lets you find a WDCB by working directory reference number, or lets you find, one at a time, all WDCBs or all of the WDCBs with a particular process ID.
  997. Note: If your foreign file system attempts to allocate a WDCB in response to an _OpenWD call and UTAllocateWDCB cannot find a free WDCB in the WDCB array, you should return the tmfoErr result from UTAllocateWDCB as your result. The Macintosh file system will then attempt to enlarge the WDCB array and if successful, will retry the _OpenWD call.  Because enlarging the WDCB array will change the array’s location in memory, you should never save the location of WDCBRecs between calls to your foreign file system. A WDCBRecPtr can only be used within the context of one file system operation.
  998. Drive Queue Elements
  999. The File Manager maintains a list of all disk drives connected to the computer. It maintains this list in the drive queue, which is a standard Operating System queue. The drive queue is initially created at system startup time. Elements are added to the queue at system startup time or when the AddDrive function is called. The drive queue can support any number of drives, limited only by memory space. Each element in the drive queue contains information about the corresponding drive; the structure of a drive queue element is defined by the DrvQEl data type.
  1000. Given a drive number, the UTFindDrive File System Utility routine will return a pointer to the associated drive queue element if it is found in the drive queue.
  1001. struct DrvQEl {
  1002. QElemPtr    qLink;    /* Next queue entry */
  1003. short    qType;    /* Flag for dQDrvSz and 
  1004.                 dQDrvSz2 */
  1005. short    dQDrive;    /* Drive number */
  1006. short     dQRefNum;    /* Driver reference number */
  1007. short    dQFSID;    /* File system ID */
  1008. unsigned short    dQDrvSz;    /* Number of logical blocks on 
  1009.                 drive */
  1010. unsigned short    dQDrvSz2;    /* Additional field for large 
  1011.                 drives */
  1012. };
  1013. typedef struct DrvQEl DrvQEl;
  1014. typedef DrvQEl *DrvQElPtr;
  1015. Field descriptions
  1016. qLink    A pointer to the next entry in the drive queue. This field is initialized when the drive is added to the drive queue by _AddDrive.
  1017. qType    The queue type. Used to specify the size of the drive. If the value of qType is 0, the number of logical blocks on the drive is contained in the dQDrvSz field alone. If the value of qType is 1, both dQDrvSz and dQDrvSz2 are used to store the number of blocks; in that case, dQDrvSz2 contains the high-order word of this number and dQDrvSz contains the low-order word.
  1018. dQDrive    The drive number of the drive. This field is initialized when the drive is added to the drive queue by _AddDrive.
  1019. dQRefNum    The driver reference number of the driver controlling the device on which the volume is mounted. This field is initialized when the drive is added to the drive queue by _AddDrive.
  1020. dQFSID    An identifier for the file system handling the volume in the drive; it is zero for volumes handled by the File Manager and nonzero for volumes handled by other file systems.
  1021. dQDrvSz    The number of logical blocks on the drive.
  1022. dQDrvSz2    An additional field to handle large drives. This field is used only if the qType field contains 1 and then, contains the high-order word specifying the number of logical blocks on the drive.
  1023. s    Warning:  If the device driver whose reference number is dQRefNum supports the Return Format List _Status call (csCode = 6), the volSize field in the returned FormatListRec with the diCIFmtFlagsCurrentBit set should be used to determine the number of blocks instead of the dQDrvSz and dQDrvSz2 fields in the DrvQEl. Drivers that support Return Format List (for example, the .Sony driver) may not support the dQDrvSz and dQDrvSz2 fields or may use them for other purposes. s
  1024. There are also four flag bytes preceding each drive queue element. The four flag bytes must be allocated by the disk driver at the same time the drive queue element is allocated. These bytes contain the following information:
  1025. Byte    Contents
  1026. 0    Bit 7=1 if the volume on the drive is locked
  1027. 1    0 if no disk in drive; 1 or 2 if disk in drive; 8 if nonejectable disk in drive; 
  1028.     $FC–$FF if disk was ejected within last 1.5 seconds; $48 if disk in drive is 
  1029.     nonejectable but driver wants a call
  1030. 2    Used internally during system startup
  1031. 3    Bit 7=0 if disk is single-sided
  1032. You can read these flags by subtracting 4 from the beginning of a drive queue element.
  1033. After successfully mounting a volume, a foreign file system should change the dqFSID field in the drive queue element to the foreign file system’s file system ID number. When the volume is unmounted and the VCB is disposed of with UTDisposeVCB, UTDisposeVCB will clear the dqFSID field in the drive queue element if the device is ejectable.
  1034. The dqFSID field in drive queue elements for the Macintosh floppy disk drives are always initially zero. Other disk drivers should initialize the dqFSID field to either the file system ID number of the file system that formatted the disk, or to fsmGenericFSID ($ffff) if the file system cannot be identified.
  1035.  
  1036. File System Location Information
  1037. A file system must be able to determine the file, directory, or volume using information passed to it in a parameter block. This section tells how to use File System Utility routines to make that determination. The section titled “HFS Specifications” in Inside Macintosh: Files lists the various ways files or directories can be specified.
  1038. About Volume Reference Numbers
  1039. Each volume is given a unique volume reference number when the volume is mounted and the volume’s VCB is added to the VCB queue by UTAddNewVCB. A volume reference number is only valid for a particular volume while that volume is mounted. If a volume is unmounted and then mounted again, a new volume reference number will be assigned to the volume.
  1040. About Directory ID Numbers
  1041. A foreign file system must be able to assign a directory ID number to all directories on a volume. Each directory ID must be unique and cannot be used as a file number for the same volume. For directories other than the root directory (which must be fsRtDirID), the directory ID must be fsUsrCNID (16) or greater.
  1042. While a volume is mounted, directory IDs must remain the same. Directory IDs must be kept the same while a volume is unmounted. Macintosh programs and the Alias Manager use directory IDs to locate directories on the volume between volume mounts.
  1043. About File Numbers
  1044. A foreign file system must be able to assign a file number to all files on a volume. A file number is never passed as a parameter to a file system routine. Each file number must be unique and cannot be used as a directory ID number for the same volume.  File numbers for files opened by programs using File Manager requests must be fsUsrCNID (16) or greater. File numbers less than fsUsrCNID are reserved for the root directory ID and for files opened by file systems for their own internal use (for example, the catalog and extents overflow files used by the HFS file system). The File Manager’s UnmountVol code returns fBsyErr to the caller and will not call your foreign file system if there are open files on the specified volume with file numbers fsUsrCNID or greater. If your foreign file system open files with file numbers less than fsUsrCNID, your foreign file system is responsible for closing those files before unmounting a volume.
  1045. While a volume is mounted, file numbers must remain the same. File numbers should, if at all possible, be kept the same while a volume is unmounted.
  1046. A foreign file system will use a file number in the file control block (FCB) of an open file. The file number can be used to find a FCB, and is used to identify multiple access paths to the same file by the UTAdjustEOF and UTCheckPermission File System Utility routines.
  1047. About File ID References
  1048. File ID references are an optional file system feature that allow the Alias Manager and other programs to track files that have been moved or renamed within a volume. If a foreign file system supports file ID references on its volumes, the foreign file system must be able to assign a file ID reference to a file, and later return that file’s location and name given only the file ID reference number, even if the file has been moved or renamed.
  1049. File ID reference numbers must be kept the same while a volume is unmounted. Macintosh programs and the Alias Manager use file ID reference numbers to locate files on the volume between volume mounts.
  1050. Determining the Volume
  1051. Before a foreign file system is called, the Macintosh file system and the File System Manager have determined what volume is the target of the call and what file system owns that volume. The volume is identified by the volume control block parameter passed to foreign file system’s HFSCIProc. UTDetermineVol can also be used to determine what volume is the target of a call.
  1052. Two file system calls are exceptions: _MountVol and _VolumeMount. _MountVol and _VolumeMount both deal with unmounted volumes (or potentially unmounted volumes), so the volume control block parameter passed to foreign file system’s HFSCIProc is unused. 
  1053. Determining the File or Directory Location
  1054. A file’s location can be given in a file system call by full pathname, or by partial pathname. A directory’s location can be given by full pathname, partial pathname, or directory ID. A foreign file system must determine the directory ID the pathname starts in before the pathname to a file or directory can be parsed. Listing 3-2, GetCurrentDir, shows how to use the contents of the call’s parameter block and File System Utility routines to determine the directory parsing should begin in. The dirID input parameter contains the directory ID from the parameter block if that field is valid for the request recieved. Not all requests include a directory ID specification. For example, the old file system calls like PBOpen do not include a directory ID specification. GetCurrentDir returns a pointer to the volume’s VCB in volCtrlBlockPtr, the directory where parsing should begin is returned in currentDirectory, and the method used to determine the volume is returned in status.
  1055. Listing 3-2.  Determining where directory parsing should start
  1056. OSErr    GetCurrentDir(ParmBlkPtr pb, long dirID, VCBPtr *volCtrlBlockPtr,
  1057.                             long *currentDirectory, short *status)
  1058. {
  1059.     OSErr            result;
  1060.     short            moreMatches;
  1061.     short            vRefNum;
  1062.     WDCBRecPtr    wdCtrlBlockPtr;
  1063.     WDPBRec        wdpb;
  1064.     
  1065.     result = UTDetermineVol(pb, status, &moreMatches, &vRefNum, 
  1066.                                     volCtrlBlockPtr);
  1067.     if (result == noErr)
  1068.     {
  1069.         switch (*status)
  1070.         {
  1071.             /* Determined by full pathname */
  1072.             case dtmvFullPathame:
  1073.                 /* Current directory is always the root directory */
  1074.                 *currentDirectory = fsRtDirID;
  1075.                 break;
  1076.             
  1077.             /* Determined by volume refNum or by drive number */
  1078.             case dtmvVRefNum:
  1079.             case dtmvDriveNum:
  1080.                 /* Current directory is dirID if specified; */
  1081.                 /* otherwise, it's the root directory */
  1082.                 if (dirID != 0)
  1083.                     *currentDirectory = dirID;
  1084.                 else
  1085.                     *currentDirectory = fsRtDirID;
  1086.                 break;
  1087.             
  1088.             /* Determined by working directory refNum */
  1089.             case dtmvWDRefNum:
  1090.                 /* Current directory is dirID if specified; */
  1091.                 /* otherwise, it's wdDirID in the WDCB */
  1092.                 if (dirID != 0)
  1093.                     *currentDirectory = dirID;
  1094.                 else
  1095.                 {
  1096.                     result = UTResolveWDCB(0, 0, pb->fileParam.ioVRefNum, 
  1097.                                                     &wdCtrlBlockPtr);
  1098.                     if (result == noErr)
  1099.                         *currentDirectory = wdCtrlBlockPtr->wdDirID;
  1100.                 }
  1101.                 break;
  1102.             
  1103.             /* Determined by default volume */
  1104.             case dtmvDefault:
  1105.                 /* Current directory is dirID if specified; */
  1106.                 /* otherwise, it's the default directory */
  1107.                 if (dirID != 0)
  1108.                     *currentDirectory = dirID;
  1109.                 else
  1110.                 {
  1111.                     wdpb.ioNamePtr = NULL; /* the name not needed */
  1112.                     result = UTGetDefaultVol(&wdpb);
  1113.                     if (result == noErr)
  1114.                         *currentDirectory = wdpb.ioWDDirID;
  1115.                 }
  1116.                 break;
  1117.             
  1118.             /* This should never happen, but... */
  1119.             default:
  1120.                 result = paramErr;
  1121.                 break;
  1122.         }
  1123.     }
  1124.     return (result);
  1125. }
  1126. Once the directory ID where parsing will begin has been determined, the pathname (if any) must be parsed to find the object. The process of parsing a pathname consists of getting the next component in a pathname and determining where that component is on the volume, and then repeating those two steps until the end of the pathname is reached. Parsing can go either up or down in a volume’s directory heirarchy so a foreign file system must be able to find an object by name within a specified directory to move down in the heirarchy and must be able to find an object’s parent directory to move up in the heirarchy. Listing 3-3 shows how to parse a pathname. How a foreign file system finds an object on a volume is specific to the foreign file system.
  1127. Listing 3-3.  Parsing a pathname
  1128. struct ObjectInfoRec {
  1129.     long        parentDirID;    /* the directory ID of the parent */
  1130.     Str31        localName;        /* the local name within said directory */
  1131.     Boolean    exists;            /* TRUE if the object exists */
  1132.     Boolean    isDir;            /* TRUE if the object is a directory */
  1133.     long        objectNumber;    /* directory ID or file number of object */
  1134. };
  1135. typedef struct ObjectInfoRec ObjectInfoRec;
  1136. typedef ObjectInfoRec *ObjectInfoRecPtr;
  1137.  
  1138. OSErr ParsePathName (VCBPtr    theVCB, long currentDirectory, 
  1139.                             StringPtr namePtr, ObjectInfoRecPtr objectInfo)
  1140. {
  1141.     OSErr            result;
  1142.     ParsePathRec    parseRec;
  1143.     Str31            lastComponent;
  1144.     
  1145.     /* init parseRec to start parsing at beginning of namePtr */
  1146.     parseRec.namePtr = namePtr;
  1147.     parseRec.startOffset = 0;
  1148.     parseRec.ComponentLength = 0;
  1149.     parseRec.moreName = false;
  1150.     parseRec.foundDelimiter = false;
  1151.     
  1152.     /* Get the length of the volume name (if any) and use it to adjust 
  1153.     ** the startOffset to point to the beginning of the partial pathname. 
  1154.     ** UTParsePathname also ensures the pathname is not NULL or an empty 
  1155.     ** string.
  1156.     */
  1157.     result = UTParsePathname(&parseRec.startOffset, parseRec.namePtr);
  1158.     if (result == noErr)
  1159.     {
  1160.         /*    At this point, startOffset is pointing at the first 
  1161.         **    character of a partial pathname (if any). For example:
  1162.         **      namePtr = 'VolName:a:b:c'    (full pathname)
  1163.         **  startOffset =         ^
  1164.         **      namePtr = ':a:b:c'                (partial pathname)
  1165.         **  startOffset =  ^
  1166.         **      namePtr = 'a'                    (partial pathname)
  1167.         **  startOffset =  ^
  1168.         **      namePtr = 'VolName:'            (full pathname)
  1169.         **  startOffset =         ^
  1170.         */
  1171.         
  1172.         /* Check for leading delimiter of the partial pathname */
  1173.         result = UTGetPathComponentName(&parseRec);
  1174.         if (result == noErr)
  1175.         {
  1176.             if (parseRec.ComponentLength == 0 && parseRec.foundDelimiter)
  1177.             {
  1178.                 /* Get past initial delimiter */
  1179.                 ++parseRec.startOffset;
  1180.             }
  1181.             
  1182.             /* At this point, startOffset is pointing at the first 
  1183.             ** character of the first component name (if any). 
  1184.             ** For example:
  1185.             **      namePtr = 'VolName:a:b:c'     (full pathname)
  1186.             **  startOffset =          ^            (moreName = true,
  1187.             **                                                 componentLength = 0)
  1188.             **      namePtr = ':a:b:c'          (partial pathname)
  1189.             **  startOffset =   ^               (moreName = true,
  1190.             **                                                 componentLength = 0)
  1191.             **      namePtr = 'a'               (partial pathname)
  1192.             **  startOffset =  ^                (moreName = true,
  1193.             **                                                 componentLength = 0)
  1194.             **      namePtr = 'VolName:'        (full pathname)
  1195.             **  startOffset =          ^        (moreName = false,
  1196.             **                                                 componentLength = 0)
  1197.             */
  1198.             
  1199.             /* Parse until there is no more pathname to parse. */
  1200.             while ((result == noErr) && parseRec.moreName)
  1201.             {
  1202.                 /* Search for the next delimiter from startOffset. */
  1203.                 result = UTGetPathComponentName(&parseRec);
  1204.                 if (result == noErr)
  1205.                 {
  1206.                     if (parseRec.ComponentLength == 0)
  1207.                     {
  1208.                         /* A delimiter was found immediately following another 
  1209.                         ** delimiter. Set current directory to parent of 
  1210.                         ** current directory. If current directory is 
  1211.                         ** fsRtDirID, then return bdNamErr (that handles the 
  1212.                         ** case of 'Root::' or 'Root:SubDir:::', etc.)
  1213.                         */
  1214.                         if (currentDirectory != fsRtDirID)
  1215.                         {
  1216.                             /* Call foreign file system specific code to get 
  1217.                             ** parent of current directory
  1218.                             */
  1219.                             result = FFSGetParent(theVCB, currentDirectory, 
  1220.                                                             ¤tDirectory);
  1221.                         }
  1222.                         else
  1223.                         {
  1224.                             /* Pathname tried to go up from root directory */
  1225.                             result = bdNamErr;
  1226.                         }
  1227.                         
  1228.                         /* startOffset = start of next component (if any). */
  1229.                         ++parseRec.startOffset;
  1230.                     }
  1231.                     else if (parseRec.moreName)
  1232.                     {
  1233.                         /* A component was found and it isn't the last 
  1234.                         ** component, so it must be a directory.  Make 
  1235.                         ** lastComponent in current directory the new current 
  1236.                         ** directory.
  1237.                         */
  1238.                         lastComponent[0] = parseRec.ComponentLength;
  1239.                         BlockMove((Ptr)((long)parseRec.namePtr + 
  1240.                                 parseRec.startOffset + 1),
  1241.                                 &lastComponent[1], 
  1242.                                 parseRec.ComponentLength);
  1243.                         /* Call foreign file system specific code to get 
  1244.                         ** directory by name in currentDirectory 
  1245.                         */
  1246.                         result = FFSGetDir(theVCB, lastComponent, 
  1247.                                             currentDirectory, ¤tDirectory);
  1248.                         
  1249.                         /* startOffset = start of next component (if any). */
  1250.                         parseRec.startOffset += parseRec.ComponentLength + 1;
  1251.                     }
  1252.                 }
  1253.             }
  1254.             if (result == noErr)
  1255.             {
  1256.                 /* There is no more pathname to parse. */
  1257.                 if (parseRec.ComponentLength == 0)
  1258.                 {
  1259.                     /* The pathname ended with '::' or the pathname was 
  1260.                     ** simply a volume name ('VolName:'), so current 
  1261.                     ** directory is the object. 
  1262.                     */
  1263.                     objectInfo->isDir = true;
  1264.                     objectInfo->objectNumber = currentDirectory;
  1265.                     /* Call foreign file system specific code to get 
  1266.                     ** information on this directory 
  1267.                     */
  1268.                     result = FFSGetDirInfo(theVCB, objectInfo);
  1269.                 }
  1270.                 else
  1271.                 {
  1272.                     /* The pathname ended with 'name:' or 'name', so name is 
  1273.                     ** the object. 
  1274.                     */
  1275.                     objectInfo->localName[0] = parseRec.ComponentLength;
  1276.                     BlockMove((Ptr)((long)parseRec.namePtr + 
  1277.                             parseRec.startOffset + 1),
  1278.                         &(objectInfo->localName[1]), 
  1279.                         parseRec.ComponentLength);
  1280.  
  1281.                     objectInfo->parentDirID = currentDirectory;
  1282.                     /* Call foreign file system specific code to get 
  1283.                     ** information on this file 
  1284.                     */
  1285.                     result = FFSGetFile(theVCB, objectInfo);
  1286.                 }
  1287.             }
  1288.         }
  1289.     }
  1290.     else
  1291.     {
  1292.         result = bdNamErr;    /* Default to bad name (if ioNamePtr != NULL 
  1293.                                     ** or ioNamePtr doesn't point to an empty 
  1294.                                     ** string). Otherwise, the code that follows 
  1295.                                     ** will set up the real result. 
  1296.                                     */
  1297.         if ((namePtr == NULL) || (namePtr[0] == 0))
  1298.         {
  1299.             /* pathname was NULL or a zero length string, so we found a 
  1300.             ** directory at the end of the string 
  1301.             */
  1302.             objectInfo->isDir = true;
  1303.             objectInfo->objectNumber = currentDirectory;
  1304.             /* Call foreign file system specific code to get information on 
  1305.             ** this directory 
  1306.             */
  1307.             result = FFSGetDirInfo(theVCB, objectInfo);
  1308.         }
  1309.     }
  1310.     return (result);
  1311. }
  1312.  
  1313. The Macintosh Volume Cache
  1314. The Macintosh operating system uses a volume (disk) cache for input and output operations. The following sections provide both general information about caching and specific information about the volume cache used by the Macintosh operating system.
  1315. About the Macintosh Volume Cache
  1316. The Macintosh operating system allows users to set aside memory for a general-purpose volume cache. A volume cache is an area in memory that is used to store blocks that have been recently read from or written to a volume. By keeping blocks in memory that are likely to be read or written again, a file system can avoid repeating I/O operations to the volume’s device and, as a result, can save a great deal of time. Use of the cache can greatly increase the speed of many applications. The one disadvantage is that memory set aside for the cache is unavailable to applications.
  1317. How Users Control the Cache
  1318. The Memory control panel allows users to change the amount of memory set aside for the cache. The Memory control panel allows users to reclaim some, but not all, of the memory used by the cache when necessary.
  1319. Although a foreign file system cannot determine the size of the cache, there is always at least 32K set aside for the cache.
  1320. The Cache and Foreign File Systems
  1321. A foreign file system can gain access to the cache by using the cache routines provided by the File System Manager. Foreign file system’s should try to use these routines for all input/output operations. There are a number of reasons why a foreign file system should use the cache routines instead of calling a device driver directly:
  1322. •    Increased throughput:  By reducing the number of input/output operations, use of the cache can dramatically increase throughput.
  1323. •    Users can control the cache:  The Control Panel lets users control the amount of memory set aside for caching.
  1324. •    Easier implementation:  The foreign file system does not have to allocate a buffer for an entire block when only part of a block is to be transferred.
  1325. •    Support for both logical and physical blocks:  The Macintosh cache routines can perform operations involving physical blocks on a volume or logical blocks for a file.
  1326. •    Asynchronous execution:  All cache routines that transfer data to or from a volume execute asynchronously. This means that control can be returned from the Macintosh file system to the caller before an input or output operation is complete. (Although to the foreign file system it appears that the cache routine waits until the operation has completed, the Macintosh file system returns control to the caller—unless the original trap was requested to be run synchronously—while waiting for the I/O operation to finish. When the I/O operation is complete, the Macintosh file system returns control to the foreign file system in such a way that normal completion of the foreign file system routine will allow execution of the application’s code to resume where it was interrupted.)
  1327. s    Warning:  It is important to note the use of the cache routines is the only way a foreign file system can perform asynchronous I/O. If a foreign file system calls a device driver directly, all I/O operations are executed synchronously, even if the calling application has requested asynchronous I/O. If your foreign file system is called at interrupt time and the device driver (or another device driver called by the device driver) is busy, calling the device driver directly will deadlock the Macintosh system. For this reason, all calls to most device drivers should be made through the cache routines. s
  1328. Cache Blocks
  1329. Each cache block is made up of header information that identifies the volume and file (if any) from which the data was taken and an offset that identifies how far, in bytes, the block was from the beginning of the volume (for volume I/O) or the beginning of the file (for file I/O) and 512 bytes of data. The structure of cache block headers and where they reside in memory is undefined. Cache routines that work with individual cache blocks always use a pointer to the cache block’s data.
  1330. The Macintosh volume cache has four categories of cache blocks:
  1331. •    Reserved cache blocks - A cache block that is in use is reserved. A reserved cache block corresponds to a logical block of a file or a physical block of a volume and is not available for reuse. A cache block is reserved with the UTGetBlock function. A reserved cache block can contain clean or dirty data (or no valid data at all if the cache block was obtained for use as a write buffer). Cache blocks should not be reserved between calls to a file system.
  1332. •    Released cache blocks - A cache block that is very likley to be needed again but is not reserved should be released. A released cache block still corresponds to a block of the file or volume, but is available for reuse. A released cache block can contain clean or dirty data.
  1333. •    Free cache blocks - A cache block that isn’t likley to be used again should be marked free. A free cache block still contains valid data and is still associated with the corresponding block of the volume, but not with a file on the volume. Dirty cache blocks should be flushed before marking them free. Free cache blocks will be reused before released cache blocks.
  1334. •    Trashed cache blocks - A cache block that will never be used again should be trashed. Trashing a cache block marks the cache block empty. Dirty cache blocks should be flushed before trashing them. Trashed cache blocks will be reused before released or free cache blocks.
  1335. As mentioned above, a cache block can be dirty or clean. A cache block is dirty when its contents do not match the contents of the corresponding block on the volume. To update the volume, a dirty cache block must be flushed by writing its contents out to the volume.  This occurs in the following cases:
  1336. •    The Macintosh operating system replaces a released cache block that is dirty with a block from the volume that is being read into the cache. When this occurs, the dirty cache block is flushed before it is replaced.
  1337. •    The foreign file system flushes the dirty cache block in response to a _FlushFile, _Close, or _FlushVol call.
  1338. •    The foreign file system flushes a cache block at some other time (for example, when handling a _Write call).
  1339. When using the cache routines, remember that any cache operation may force a previously cached block to be removed from memory. If there are no trashed or free cache blocks, a new block that is read into the cache from the volume replaces the contents of the least recently used of the released blocks (if any) in the cache.
  1340. Logical to Physical Block Mapping
  1341. The Macintosh cache routines can read or write either logical blocks of a file or physical blocks of a volume. However, because disk driver device calls always read or write physical blocks of a volume, a foreign file system must provide a routine to map logical file blocks to physical volume blocks called the logical to physical routine. The address of the logical to physical routine is passed to the File System Manager in the foreign file system’s HFSCIRec and as a parameter to some cache routines. The interface for the logical to physical routine a FSM-based foreign file system must supply is defined in “The HFS Component Interface” chapter.
  1342. It is the responsibility of the foreign file system to return an eofErr when a request for data is beyond the current logical end of file. It is the responsibility of the logical to physical routine to return an eofErr error when a cache routine asks for block mapping beyond the current physical end of file.
  1343.  
  1344. File System Utility Routines
  1345. UTAllocateFCB
  1346. Use the UTAllocateFCB function to allocate a FCBRec in the FCB array when opening a file.
  1347. pascal OSErr UTAllocateFCB(short *fileRefNum, 
  1348.                             FCBRecPtr *fileCtrlBlockPtr);
  1349. fileRefNum    Contains a pointer to a short. UTAllocateFCB places the file reference number of the allocated FCBRec into the field referred to by this parameter.
  1350. fileCtrlBlockPtr    Contains a pointer to a FCBRecPtr. UTAllocateFCB places a pointer to the allocated FCBRec into the field referred to by this parameter.
  1351. If an FCBRec can be allocated in the FCB array, the FCB will be marked in use (fcbFlNm is set to -1), the file reference number will be returned in fileRefNum, and a pointer to the allocated FCBRec will be returned in fileCtrlBlockPtr. The allocated FCBRec is not initialized in any way. It is up to your foreign file system to initialize all fields in the FCBRec.
  1352. If an FCB cannot be allocated because there are no FCBRecs left in the FCB array, this function will return a tmfoErr.
  1353. Note: If your foreign file system returns the tmfoErr result from UTAllocateFCB as the result to _Open, the Macintosh file system will attempt to enlarge the FCB array and if successful, will retry the _Open call.  Because enlarging the FCB array will change the array’s location in memory, you should never save the location of a FCBRec between calls to your foreign file system. A FCBRecPtr can only be used within the context of one file system operation.
  1354. When you no longer need an allocated FCBRec (either because the file could not be opened or when the file is closed), release it with UTReleaseFCB.
  1355. Result codes
  1356. noErr    0    No error
  1357. tmfoErr    -42    There are no free FCBRecs in the FCB array
  1358. UTReleaseFCB
  1359. Use the UTReleaseFCB function to release an allocated FCBRec in the FCB array when closing a file.
  1360. pascal OSErr UTReleaseFCB(short fileRefNum);
  1361. fileRefNum    Contains the file reference number that specifies the FCBRec to release.
  1362. When you no longer need an allocated FCBRec (either because the file could not be opened or when the file is closed), release it with UTReleaseFCB. UTReleaseFCB will release an FCBRec in the FCB array and mark it free (the FCBRec is cleared).
  1363. Result codes
  1364. noErr    0    No error
  1365. fnOpnErr    -38    The file is not open
  1366. rfNumErr    -51    The file reference number is not valid
  1367. UTLocateFCB
  1368. Use the UTLocateFCB function to find a FCBRec in the FCB array.
  1369. pascal OSErr UTLocateFCB(VCBPtr volCtrlBlockPtr, unsigned long fileNum, 
  1370.             StringPtr namePtr, short *fileRefNum, 
  1371.             FCBRecPtr *fileCtrlBlockPtr);
  1372. volCtrlBlockPtr    Contains a VCBPtr that specifies the volume the open file is on.
  1373. fileNum    Contains a file number that specifies the FCBRec to search for. If you want to find the FCBRec by file name, set this parameter to zero.
  1374. namePtr    Contains a pointer to a string that specifies the file name to search for. This parameter is ignored if fileNum is not zero.
  1375. fileRefNum    Contains a pointer to a short. UTLocateFCB places the file reference number of the FCBRec found into the field referred to by this parameter.
  1376. fileCtrlBlockPtr    Contains a pointer to a FCBRecPtr. UTLocateFCB places a pointer to the FCBRec found into the field referred to by this parameter.
  1377. UTLocateFCB will find a FCBRec in the FCB array that’s on the volume specified by volCtrlBlockPtr. If fileNum is not zero, UTLocateFCB will search the FCB array for the first FCBRec that has a matching file number. If fileNum is zero, UTLocateFCB will search the FCB array for the first FCBRec that has a matching file name. UTLocateFCB always starts searching from the beginning of the FCB array and returns the first match it finds. UTLocateFCB returns the file reference number of the matching FCBRec in fileRefNum and a pointer to the matching FCBRec in fileCtrlBlockPtr.
  1378. Result codes
  1379. noErr    0    No error
  1380. fnfErr    -38    A matching FCB was not found
  1381. UTLocateNextFCB
  1382. Use the UTLocateNextFCB function to continue seaching for a FCBRec in the FCB array.
  1383. pascal OSErr UTLocateNextFCB(VCBPtr volCtrlBlockPtr, 
  1384.                             unsigned long fileNum, StringPtr namePtr, 
  1385.                             short *fileRefNum, 
  1386.                             FCBRecPtr *fileCtrlBlockPtr);
  1387. volCtrlBlockPtr    Contains a VCBPtr that specifies the volume the open file is on.
  1388. fileNum    Contains a file number that specifies the FCBRec to search for. If you want to find the FCBRec by file name, set this parameter to zero.
  1389. namePtr    Contains a pointer to a string that specifies the file name to search for. This parameter is ignored if fileNum is not zero.
  1390. fileRefNum    Contains a pointer to a short. On input, the field referred to by this parameter contains the file reference number of the last match found by UTLocateFCB or UTLocateNextFCB. On output, UTLocateNextFCB places the file reference number of the FCBRec found into the field referred to by this parameter.
  1391. fileCtrlBlockPtr    Contains a pointer to a FCBRecPtr. UTLocateFCB places a pointer to the FCBRec found into the field referred to by this parameter.
  1392. UTLocateNextFCB will find a FCBRec in the FCB array that’s on the volume specified by volCtrlBlockPtr. If fileNum is not zero, UTLocateNextFCB will search the FCB array for a FCBRec that has a matching file number. If fileNum is zero, UTLocateNextFCB will search the FCB array for a FCBRec that has a matching file name. UTLocateNextFCB always starts searching from the FCBRec specified by fileRefNum and returns the next match it finds. UTLocateNextFCB returns the file reference number of the matching FCBRec in fileRefNum and a pointer to the matching FCBRec in fileCtrlBlockPtr.
  1393. Result codes
  1394. noErr    0    No error
  1395. fnfErr    -38    A matching FCB was not found
  1396. UTIndexFCB
  1397. Use the UTIndexFCB function to index through the open FCBs on a volume.
  1398. pascal OSErr UTIndexFCB(VCBPtr volCtrlBlockPtr, short *fileRefNum,
  1399.                         FCBRecPtr *fileCtrlBlockPtr);
  1400. volCtrlBlockPtr    Contains a VCBPtr that specifies the volume the open file is on.
  1401. fileRefNum    Contains a pointer to a short. On input, the field referred to by this parameter contains the file reference number of the last match found by UTIndexFCB or zero to search for the first FCBRec. On output, UTIndexFCB places the file reference number of the FCBRec found into the field referred to by this parameter.
  1402. fileCtrlBlockPtr    Contains a pointer to a FCBRecPtr. UTIndexFCB places a pointer to the FCBRec found into the field referred to by this parameter.
  1403. UTIndexFCB will find a FCBRec in the FCB array that’s on the volume specified by volCtrlBlockPtr. UTIndexFCB always starts searching from the FCBRec specified by fileRefNum and returns the next FCBRec it finds on the specified volume. UTIndexFCB returns the file reference number of the matching FCBRec in fileRefNum and a pointer to the matching FCBRec in fileCtrlBlockPtr.
  1404. Result codes
  1405. noErr    0    No error
  1406. fnfErr    -38    A matching FCB was not found
  1407. rfNumErr    -51    The file reference number is not valid
  1408. UTResolveFCB
  1409. Use the UTResolveFCB function to map a file reference number to its FCBRec.
  1410. pascal OSErr UTResolveFCB(short fileRefNum, 
  1411.                             FCBRecPtr *fileCtrlBlockPtr);
  1412. fileRefNum    Contains a file reference number that specifies the FCBRec.
  1413. fileCtrlBlockPtr    Contains a pointer to a FCBRecPtr. UTResolveFCB places a pointer to the FCBRec found into the field referred to by this parameter.
  1414. Given a file reference number, UTResolveFCB returns a pointer to a FCBRec in fileCtrlBlockPtr.
  1415. If the file reference number is valid, UTResolveFCB will return noErr; even if the file is not open. You can use UTCheckFileRefNum to see if a file reference number refers to an open file.
  1416. Result codes
  1417. noErr    0    No error
  1418. rfNumErr    -51    The file reference number is not valid
  1419. UTAllocateVCB
  1420. Use the UTAllocateVCB function to allocate memory in the system heap for a new VCB.
  1421. pascal OSErr UTAllocateVCB(unsigned short *sysVCBLength, 
  1422.                             VCBPtr *volCtrlBlockPtr, 
  1423.                             unsigned short addSize);
  1424. sysVCBLength    Contains a pointer to an unsigned short. UTAllocateVCB places the size of the system VCB into the field referred to by this parameter.
  1425. volCtrlBlockPtr    Contains a pointer to an VCBPtr. UTAllocateVCB places a pointer to the new VCB into the field referred to by this parameter.
  1426. addSize    Contains the amount of addition storage to allocate for the foreign file system’s private use, or zero.
  1427. UTAllocateVCB will allocate cleared memory from the system heap for a new VCB. The amount of memory allocated by UTAllocateVCB is determined by adding the size of the system VCB structure to the amount of additional memory needed for the foreign file system’s private use. A pointer to the new VCB is returned in volCtrlBlockPtr and the size of the system VCB structure is returned in sysVCBLength. Thus, the additional foreign file system private data (if any) starts at volCtrlBlockPtr + sysVCBLength.
  1428. Result codes
  1429. noErr    0    No error
  1430. memFullErr    -108    The VCB could not be allocated; no memory 
  1431.         available
  1432. UTAddNewVCB
  1433. Use the UTAddNewVCB function to add a new VCB to the VCB queue and assign a volume reference number to the volume.
  1434. pascal OSErr UTAddNewVCB(short driveNum, short *vRefNum, 
  1435.                         VCBPtr volCtrlBlockPtr);
  1436. driveNum    Contains the drive number of the drive the volume is on.
  1437. vRefNum    Contains a pointer to a short. UTAddNewVCB places the volume reference number assigned to the volume into the field referred to by this parameter.
  1438. volCtrlBlockPtr    Contains a pointer to the VCB to add to the VCB queue.
  1439. UTAddNewVCB assigns an unused volume reference number to a VCB and adds it to the VCB queue. The volume reference number is returned in vRefNum.
  1440. The following fields in the VCB are also initialized by UTAddNewVCB
  1441. •    qType is assigned fsQType (5).
  1442. •    vcbDrvNum is assigned the drive number of the drive the volume is on
  1443. •    vcbDRefNum is assigned the driver reference number of the drive the volume is on
  1444. •    vcbVRefNum is assigned the volume reference number
  1445. •    vcbBufAdr may be assigned a value for the system’s cache use.
  1446. If the VCB is the first VCB added to the VCB queue (this will probably never happen for a foreign file system), UTAddNewVCB will also make the volume the default volume.
  1447. Result codes
  1448. noErr    0    No error
  1449. paramErr    -50    volCtrlBlockPtr was NULL
  1450. nsDrvErr    -56    The drive specified by driveNum could not be 
  1451.         found in the drive queue
  1452. UTDisposeVCB
  1453. Use the UTDisposeVCB function to dispose of a VCB allocated with the UTAllocateVCB function.
  1454. pascal OSErr UTDisposeVCB(VCBPtr volCtrlBlockPtr);
  1455. volCtrlBlockPtr    Contains a pointer to the VCB to dispose.
  1456. UTDisposeVCB performs the following
  1457. •    Close all working directories on the volume
  1458. •    Remove the VCB from the VCB queue
  1459. •    If the volume’s drive is ejectable, clear the dQFSID field in the DrvQEl of the volume’s drive  (a disk owned by another file system could be the next disk inserted into the ejectable drive)
  1460. •    If the volume is the default volume, clear the system’s default volume
  1461. •    Dispose of the memory used by the VCB
  1462. You should always use UTDisposeVCB to dispose of your VCB instead of freeing the memory yourself.
  1463. Result codes
  1464. noErr    0    No error
  1465. nsDrvErr    -56    The volume’s drive could not be found in the 
  1466.         drive queue
  1467. UTLocateVCBByRefNum
  1468. Use the UTLocateVCBByRefNum function to locate a VCB using a volume reference number, drive number, or working.directory number.
  1469. pascal OSErr UTLocateVCBByRefNum(short refNum, short *vRefNum, 
  1470.                                 VCBPtr *volCtrlBlockPtr);
  1471. refNum    Contains a volume reference number, drive number, or working directory number.
  1472. vRefNum    Contains a pointer to a short. UTLocateVCBByRefNum places the reference number of the volume found into the field referred to by this parameter.
  1473. volCtrlBlockPtr    Contains a pointer to a VCBPtr. UTLocateVCBByRefNum places a pointer to the VCB found into the field referred to by this parameter.
  1474. UTLocateVCBByRefNum finds the VCB associated with a volume reference number, drive number, or working.directory number and returns a pointer to the VCB in volCtrlBlockPtr and the volume reference number in vRefNum.
  1475. Result codes
  1476. noErr    0    No error
  1477. rfNumErr    -51    The working directory reference number is 
  1478.         invalid
  1479. nsvErr    -56    A matching volume could not be found in the 
  1480.         VCB queue
  1481. UTLocateVCBByName
  1482. Use the UTLocateVCBByName function to locate the first VCB that matches the volume name specified.
  1483. pascal OSErr UTLocateVCBByName(StringPtr namePtr, short *moreMatches, 
  1484.                             short *vRefNum, VCBPtr *volCtrlBlockPtr)
  1485. namePtr    Contains a pointer to a volume name (which must end with a colon ‘:’ character) or to a full pathname.
  1486. moreMatches    Contains a pointer to a short. If there is another volume with a matching name, UTLocateVCBByName places the length of the volume name (not including the trailing colon) into the field referred to by this parameter. If this is the last volume with a matching name or no matches are found, UTLocateVCBByName places zero into the field referred to by this parameter.
  1487. vRefNum    Contains a pointer to a short. UTLocateVCBByName places the reference number of the volume found into the field referred to by this parameter.
  1488. volCtrlBlockPtr    Contains a pointer to a VCBPtr. UTLocateVCBByName places a pointer to the VCB found into the field referred to by this parameter.
  1489. UTLocateVCBByName finds the first VCB with the specified volume name and returns a pointer to the VCB in volCtrlBlockPtr and the volume reference number in vRefNum.
  1490. UTLocateVCBByName also checks to see if there are more volumes in the VCB queue with the specified name. If there are, moreMatches returns the length of the volume name. If the volume found is the only volume with the specified name (or if no matching volumes are found), moreMatches returns zero. To find the next volume with a matching name, use the UTLocateNextVCB routine.
  1491. Result codes
  1492. noErr    0    No error
  1493. bdNamErr    -37    namePtr was NULL, or namePtr does not point 
  1494.         to a volume name or full pathname 
  1495. nsvErr    -56    A matching volume could not be found in the 
  1496.         VCB queue
  1497. UTLocateNextVCB
  1498. Use the UTLocateNextVCB function to continue seaching for a VCB by name in the VCB queue.
  1499. pascal OSErr UTLocateNextVCB(StringPtr namePtr, short *moreMatches, 
  1500.                             short *vRefNum, VCBPtr *volCtrlBlockPtr);
  1501. namePtr    Contains a pointer to a volume name (which must end with a colon ‘:’ character) or to a full pathname.
  1502. moreMatches    Contains a pointer to a short. On input, the field referred to by this parameter contains the length of the volume name as returned by a previous call to UTLocateVCBByName or UTLocateNextVCB, or zero to force UTLocateNextVCB to re-parse the pathname. On output, UTLocateNextVCB places the length of the volume name (not including the trailing colon) into the field referred to by this parameter. If this is the last volume with a matching name or no matches are found UTLocateNextVCB places zero into the field referred to by this parameter.
  1503. vRefNum    Contains a pointer to a short. UTLocateNextVCB places the reference number of the volume found into the field referred to by this parameter.
  1504. volCtrlBlockPtr    Contains a pointer to a VCBPtr. UTLocateNextVCB places a pointer to the VCB found into the field referred to by this parameter.
  1505. UTLocateNextVCB finds the next VCB with the specified volume name. UTLocateNextVCB always starts searching from the VCB specified by volCtrlBlockPtr and returns the next VCB it finds in the VCB queue. UTLocateNextVCB returns a pointer to the VCB in volCtrlBlockPtr and the volume reference number in vRefNum.
  1506. After finding a match, UTLocateNextVCB also checks to see if there are more volumes in the VCB queue with the specified name. If there are, moreMatches returns the length of the volume name. If the volume found is the only volume with the specified name (or if no matching volumes are found), moreMatches returns zero.
  1507. Result codes
  1508. noErr    0    No error
  1509. bdNamErr    -37    namePtr was NULL, or namePtr does not point 
  1510.         to a volume name or full pathname 
  1511. nsvErr    -56    A matching volume could not be found in the 
  1512.         VCB queue
  1513. UTAllocateWDCB
  1514. Use the UTAllocateWDCB function to allocate a working directory in the WDCB array.
  1515. pascal OSErr UTAllocateWDCB(WDPBPtr paramBlock);
  1516. paramBlock    Contains a pointer to a working directory parameter block.
  1517. Parameter Block
  1518. ´    ioVRefNum    short    On input, contains the volume reference 
  1519.             number. On output, contains the 
  1520.             working directory reference number.
  1521. ¨    ioWDCreated    short    If a working directory is not created, 
  1522.             zero is returned. If a working directory 
  1523.             is created, non-zero is returned.
  1524. Æ    ioWDProcID    long    Contains the working directory user 
  1525.             identifier.
  1526. Æ    ioWDDirID    long    Contains the working directory’s 
  1527.             directory ID.
  1528. UTAllocateWDCB uses the ioVRefNum, ioWDProcID, and ioPDDirID fields in the WDPBRec to allocate a working directory in the WDCB array. UTAllocateWDCB places the working directory reference number into the ioVRefNum field of the WDPBRec.
  1529. If the specified directory has already been made a working directory using the same ioWDProcID value, a new working directory will not be allocated; instead, the existing working directory reference number will be returned and ioWDCreated will be set to zero.
  1530. Note:  The ioWDCreated field is named filler1 in current versions of Files.C.
  1531. If a WDCB array cannot be allocated, this function will return a tmfoErr.
  1532. Note: If all WDCBRecs in the WDCB array are in use, an attempt will be made to enlarge the WDCB array. Because enlarging the WDCB array will change the array’s location in memory, you should never save the location of a WDCBRec between calls to your foreign file system. A WDCBRecPtr can only be used within the context of one file system operation.
  1533. When you no longer need an allocated working directory, release it with UTReleaseWDCB.
  1534. Result codes
  1535. noErr    0    No error
  1536. tmfoErr    -42    There are no free WDCBRecs in the WDCB 
  1537.         array
  1538. UTReleaseWDCB
  1539. Use the UTReleaseWDCB function to release an allocated working directory in the WDCB array when closing a working directory.
  1540. pascal OSErr UTReleaseWDCB(short wdRefNum);
  1541. wdRefNum    Contains the working directory reference number that specifies the working directory to release.
  1542. When you no longer need an allocated working directory, release it with UTReleaseWDCB. UTReleaseWDCB will release an WDCBRec in the WDCB array and mark it free.
  1543. Result codes
  1544. noErr    0    No error
  1545. rfNumErr    -51    The working directory reference number is not 
  1546.         valid or does not refer to an open working 
  1547.         directory
  1548. UTResolveWDCB
  1549. Use the UTResolveWDCB function to find a WDCBRec in the WDCB array.
  1550. pascal OSErr UTResolveWDCB(long procID, short wdIndex, short wdRefNum, 
  1551.                             WDCBRecPtr *wdCtrlBlockPtr);
  1552. procID    Contains a working directory user identifier or zero
  1553. wdIndex    Contains an index.
  1554. wdRefNum    Contains the working directory reference number that specifies the working directory, or contains a volume reference number or drive number that specifies the volume.
  1555. wdCtrlBlockPtr    Contains a pointer to a WDCBRecPtr. UTResolveWDCB places a pointer to the WDCBRec found into the field referred to by this parameter.
  1556. UTResolveWDCB locates a WDCBRec in the WDCB array according to these rules:
  1557. •    If wdIndex is zero or negative, UTResolveWDCB uses the working directory reference number in wdRefNum to find the WDCBRec. The procID parameter is ignored in this case.
  1558. •    If wdIndex is positive and procID is zero, UTResolveWDCB finds the WDCBRec  whose working directory index is wdIndex on the volume specified by wdRefNum.
  1559. •    If wdIndex is positive and procID is non-zero, UTResolveWDCB finds the WDCBRec  whose working directory index is wdIndex with the working directory user identifier specified by procID on the volume specified by wdRefNum.
  1560. Result codes
  1561. noErr    0    No error
  1562. nsvErr    -35    No matching working directory was found by 
  1563.         the indexed search
  1564. rfNumErr    -51    The working directory reference number is not 
  1565.         valid or does not refer to an open working 
  1566.         directory
  1567. UTFindDrive
  1568. Use the UTFindDrive function to find a drive queue element in the drive queue.
  1569. pascal OSErr UTFindDrive(short driveNum, DrvQElPtr *driveQElementPtr);
  1570. driveNum    Contains the drive number that specifies the drive.
  1571. driveQElementPtr    Contains a pointer to a DrvQElPtr. UTFindDrive places a pointer to the drive queue element found into the field referred to by this parameter.
  1572. UTFindDrive locates a drive queue element in the drive queue. If a matching drive queue element is found and its dQFSID field is zero, UTFindDrive will return noErr. If a matching drive queue element is found and its dQFSID field is not zero (when the drive is owned by a foreign file system), UTFindDrive will return extFSErr.
  1573. Result codes
  1574. noErr    0    A matching drive queue element was found 
  1575.         with a zero dQFSID field
  1576. nsDrvErr    -56    No matching drive queue element was found
  1577. extFSErr    -58    A matching drive queue element was found 
  1578.         with a non-zero dQFSID field
  1579. UTAdjustEOF
  1580. Use the UTAdjustEOF function to adjust the logical and physical EOF of all open FCBs for the specified file fork.
  1581. pascal OSErr UTAdjustEOF(short fileRefNum);
  1582. fileRefNum    Contains a file reference number that specifies the reference FCBRec.
  1583. UTAdjustEOF finds the open FCB specified by fileRefNum and gets that file’s file number and VCBPtr. UTAdjustEOF then copies the logical end of file (fcbEOF) and physical end of file (fcbPLen) from the specified FCBRec to all other open FCBRecs that refer to the same file fork.
  1584. Result codes
  1585. noErr    0    No error
  1586. rfNumErr    -51    The file reference number is not valid
  1587. UTSetDefaultVol
  1588. Use UTSetDefaultVol to set the default volume and working directory in response to _SetVol or _HSetVol.
  1589. pascal OSErr UTSetDefaultVol(long nodeHint, unsigned long dirID,
  1590.                             short refNum);
  1591. nodeHint    Contains a long that specifies optional file system specific information about the directory.
  1592. dirID    Contains a directory ID or 0.
  1593. refNum    Contains a volume reference number or a working directory number.
  1594. The parameters you pass to UTSetDefaultVol depend on which file system call you are responding to, _SetVol or _HSetVol, and on the parameters passed the file system call.
  1595. If you are responding to _SetVol and ioVRefNum is a working directory number, then refNum must be set to the working directory number (ioVRefNum), dirID must be 0, and nodeHint is ignored (nodeHint information is obtained from the working directory specified).
  1596. If you are responding to _SetVol and ioVRefNum is a volume reference number or drive number, then refNum must be the volume reference number (obtained from vcbVRefNum in the VCB), dirID must be set to fsRtDirID, and nodeHint can contain optional file system specific information about the directory that you supply.
  1597. If you are responding to _HSetVol, then refNum must be the volume reference number (obtained from vcbVRefNum in the VCB), dirID must be be the directory specified by the combination of ioVRefNum, ioDirID and ioNamePtr, and nodeHint can contain optional file system specific information about the directory that you supply.
  1598. Result codes
  1599. noErr    0    No error
  1600. rfNumErr    -51    The refNum is invalid
  1601. UTGetDefaultVol
  1602. Use UTGetDefaultVol to get the default volume and working directory in response to _GetVol or _HGetVol.
  1603. pascal OSErr UTGetDefaultVol(WDPBPtr paramBlock);
  1604. paramBlock    Contains a pointer to a working directory parameter block.
  1605. Parameter Block
  1606. ¨    ioNamePtr    long    Contains a pointer to a Str31 or 
  1607.             NULL. If not NULL, UTGetDefaultVol 
  1608.             will return the volume’s name in the Str31 
  1609.             specified by this field.
  1610. ¨    ioVRefNum    short    UTGetDefaultVol places the working 
  1611.             directory number of the default volume 
  1612.             in this field. 
  1613. ¨    ioWDProcID    long    UTGetDefaultVol places the working 
  1614.             directory user identifier in this field.
  1615. ¨    ioWDVRefNum    short    UTGetDefaultVol places the volume 
  1616.             reference number of the default volume 
  1617.             in this field.
  1618. ¨    ioWDDirID    long    UTGetDefaultVol places the directory 
  1619.             ID number of the default directory in 
  1620.             this field.
  1621. UTGetDefaultVol returns the default volume name, the default volume’s working directory number, the default volume’s user identifier, the default volume’s volume reference number, and the default directory’s directory ID number.
  1622. Result codes
  1623. noErr    0    No error
  1624. nsvErr    -35    The default directory is not set
  1625. UTEjectVol
  1626. Use UTEjectVol to eject a volume and mark it offline.
  1627. pascal OSErr UTEjectVol(VCBPtr volCtrlBlockPtr);
  1628. volCtrlBlockPtr    Contains a pointer to the VCB of the volume to eject and mark offline.
  1629. UTEjectVol ejects and marks offline the volume specified by volCtrlBlockPtr. If the volume has already been ejected, UTEjectVol does nothing and returns noErr. If the volume is already offline, but has not been ejected, UTEjectVol will eject it.
  1630. If the volume’s drive is ejectable, UTEjectVol clears the dQFSID field in the DrvQEl of the volume’s drive (a disk owned by another file system could be the next disk inserted into the ejectable drive).
  1631. Note: Before calling UTEjectVol, the foreign file system must flush any cached data associated with the volume using UTFlushCache. If the device is ejectable, UTFlushCache's fcOption should be set to fcTrashMask. If the device is not ejectable, UTFlushCache's rbOption should be set to rbDefault.
  1632. Result codes
  1633. noErr    0    No error
  1634. paramErr    -50    volCtrlBlockPtr does not point to a valid VCB
  1635. any of the result codes returned by the disk driver to an eject call
  1636. UTCheckWDRefNum
  1637. Use UTCheckWDRefNum to make sure a working directory reference number is valid and open.
  1638. pascal OSErr UTCheckWDRefNum(short wdRefNum);
  1639. wdRefNum    Contains the working directory reference number.
  1640. UTCheckWDRefNum will return noErr if a working directory reference number is valid and open.
  1641. Result codes
  1642. noErr    0    No error
  1643. rfNumErr    -51    The working directory reference number is not 
  1644.         valid or does not refer to an open working 
  1645.         directory
  1646. UTCheckFileRefNum
  1647. Use UTCheckFileRefNum to make sure a file reference number is valid and open.
  1648. pascal OSErr UTCheckFileRefNum(short fileRefNum);
  1649. fileRefNum    Contains the file reference number.
  1650. UTCheckFileRefNum will return noErr if a file reference number is valid and open.
  1651. Result codes
  1652. noErr    0    No error
  1653. rfNumErr    -51    The file reference number is not valid or does 
  1654.         not refer to an open file
  1655. UTCheckVolRefNum
  1656. Use UTCheckVolRefNum to make sure a volume reference number is valid.
  1657. pascal OSErr UTCheckVolRefNum(short vRefNum);
  1658. vRefNum    Contains the volume reference number.
  1659. UTCheckVolRefNum will return noErr if a volume reference number is valid. The vRefNum parameter must be a volume reference number, not a driver number, zero, or a working directory reference number.
  1660. Result codes
  1661. noErr    0    No error
  1662. rfNumErr    -51    The volume reference number is not valid
  1663. UTCheckPermission
  1664. Use UTCheckPermission to check the file access permission requested in response to _Open or _OpenRF if your foreign file system is using the Macintosh file system’s access permission model.
  1665. pascal OSErr UTCheckPermission(VCBPtr volCtrlBlockPtr, short *modByte, 
  1666.                                 unsigned long fileNum, 
  1667.                                 ParmBlkPtr paramBlock);
  1668. volCtrlBlockPtr    Contains a VCBPtr that specifies the volume the file to be opened is on.
  1669. modByte    Contains a pointer to a short. On input, the field referred to by this parameter contains the values your file system plans to put into the fcbFlags (in the high byte) and fcbTypByt (in the low byte) fields in the FCB. On output, UTCheckPermission places the corrected values for fcbFlags and fcbTypByt into the field referred to by this parameter.
  1670. fileNum    Contains a file number that specifies the file to be opened.
  1671. paramBlock    Contains a pointer to the parameter block used to make the _Open or _Open request.
  1672. UTCheckPermission will check the file access permission requested in response to _Open or _OpenRF to see if it is possible using the Macintosh file system’s access permission model.
  1673. Before making this call, the foreign file system must determine what file number the open file will have. The file number along with the VCBPtr will allow UTCheckPermission to determine if the requested access permission will conflict with any other access paths to the file.
  1674. The foreign file system must also determine what values will be put into the fcbFlags and fcbTypByt fields of the FCBRec and supply those values to UTCheckPermission in the modByte parameterr; fcbFlags in the high byte, fcbTypByt in the low byte.
  1675. The bits for the fcbFlags byte should be set as follows
  1676. •    The fcbWriteBit should be set if the requested permissions in the ioPermssn field of the parameter block are fsCurPerm, fsWrPerm, fsRdWrPerm, or fsRdWrShPerm.
  1677. •    The fcbResourceBit should be set if responding to an _OpenRF request.
  1678. •    The fcbSharedWriteBit should be set if the requested permissions in the ioPermssn field of the parameter block are fsRdWrShPerm.
  1679. •    The fcbFileLockedBit should be set if the file is locked.
  1680. All other bits in in the fcbFlags field should be clear.
  1681. The fcbTypByt (used for the file version by the MFS file system) must be zero because the Resource Manager, Segment Loader, and Standard File Package won’t operate on files with non-zero version numbers.
  1682. If UTCheckPermission returns noErr, then the value returned in modByte contains the corrected values for fcbFlags and fcbTypByt and may be copied into the FCBRec for the new access path.
  1683. If UTCheckPermission returns opWrErr, then the file reference number of the existing exclusive-write path is returned in the ioRefNum field of the parameter block.
  1684. For a description of the Macintosh file system’s access permission model, see Inside Macintosh: Files pages 2-7 and 2-8 and the description of PBHOpen and PBHOpenRF on pages 2-184 through 2-186.
  1685. Result codes
  1686. noErr    0    No error
  1687. opWrErr    -49    fsWrPerm, fsRdWrPerm, or fsRdWrShPerm 
  1688.         was requested on a file with an existing 
  1689.         exclusive-write access path
  1690. permErr    -54    fsWrPerm, fsRdWrPerm, or fsRdWrShPerm 
  1691.         was requested on a locked file
  1692. UTCheckVolOffline
  1693. Use UTCheckVolOffline to make sure a volume reference number is valid and the volume is online.
  1694. pascal OSErr UTCheckVolOffline(short vRefNum);
  1695. vRefNum    Contains the volume reference number.
  1696. UTCheckVolOffline will return noErr if a volume reference number is valid and the volume is online.
  1697. Result codes
  1698. noErr    0    No error
  1699. rfNumErr    -51    The volume reference number is not valid
  1700. volOffLinErr    -53    The volume is offline
  1701. UTCheckVolModifiable
  1702. Use UTCheckVolModifiable to see if a volume can be written to.
  1703. pascal OSErr UTCheckVolModifiable(short vRefNum);
  1704. vRefNum    Contains the volume reference number.
  1705. UTCheckVolModifiable checks the volume’s vcbAtrb field in its VCB to determine if the volume is locked by hardware or software.
  1706. Result codes
  1707. noErr    0    No error
  1708. wPrErr    -44    The volume is write protected by hardware
  1709. vLckdErr    -46    The volume is locked by software
  1710. UTCheckFileModifiable
  1711. Use UTCheckFileModifiable to see if a file can be written to.
  1712. pascal OSErr UTCheckFileModifiable(short fileRefNum);
  1713. fileRefNum    Contains the file reference number.
  1714. UTCheckFileModifiable checks the volume’s vcbAtrb field in its VCB to determine if the volume is locked by hardware or software and checks the file's fcbFlags in its FCBRec to determine if the file can be written to through the access path specified by fileRefNum.
  1715. Result codes
  1716. noErr    0    No error
  1717. wPrErr    -44    The volume is write protected by hardware
  1718. vLckdErr    -46    The volume is locked by software
  1719. wrPermErr    -61    The file access path does not have write 
  1720.         permission
  1721. UTCheckDirBusy
  1722. Use UTCheckDirBusy to see if a directory is an open working directory.
  1723. pascal OSErr UTCheckDirBusy(VCBPtr volCtrlBlockPtr, 
  1724.                             unsigned long dirID);
  1725. volCtrlBlockPtr    Contains a VCBPtr that specifies the volume the directory is on.
  1726. dirID    Contains the directory ID.
  1727. UTCheckDirBusy checks to see if the directory specified by dirID is an open working directory on the volume specified by volCtrlBlockPtr.
  1728. Result codes
  1729. noErr    0    No error
  1730. fBsyErr    -47    The directory is an open working directory
  1731. UTDetermineVol
  1732. Use UTDetermineVol to determine what volume a parameter block refers to and how that determination was made.
  1733. pascal OSErr UTDetermineVol(ParmBlkPtr paramBlock, short *status, 
  1734.                             short *moreMatches, short *vRefNum, 
  1735.                             VCBPtr *volCtrlBlockPtr);
  1736. paramBlock    Contains a pointer to the parameter block to evaluate.
  1737. status    Contains a pointer to a short. UTDetermineVol places the decisive factor used to determine what volume paramBlock refers to into the field referred to by this parameter. The status values returned are:
  1738.     dtmvError        = 0    could not determine volume
  1739.     dtmvFullPathame    = 1    determined by full pathname
  1740.     dtmvVRefNum    = 2    determined by volume 
  1741.                     reference number
  1742.     dtmvWDRefNum    = 3    determined by working 
  1743.                     directory reference number
  1744.     dtmvDriveNum    = 4    determined by drive number
  1745.     dtmvDefault        = 5    determined by default volume
  1746. moreMatches    Contains a pointer to a short. If the volume was determined by full pathname and more than one mounted volume has the volume name passed by paramBlock, UTDetermineVol places a non-zero value (the length of the volume name) into the field referred to by this parameter. The value returned the field referred to by this parameter should be ignored if status is not dtmvFullPathame.
  1747. vRefNum    Contains a pointer to a short. UTDetermineVol places the volume reference number into the field referred to by this parameter. 
  1748. volCtrlBlockPtr    Contains a pointer to an VCBPtr. UTDetermineVol places a pointer to the VCB into the field referred to by this parameter.
  1749. UTDetermineVol uses the parameter block pointed to by paramBlock to determine what volume to use and returns the decisive factor used to determine the volume. The decisive factor used to determine the volume along with the other contents of the parameter block are used to find the file or directory the parameter block refers to.
  1750. UTDetermineVol determines the volume by searching in the following order:
  1751. 1    Full pathname - This method is used if ioNamePtr is not NULL and points to a full pathname (see Inside Macintosh: Files for the definition of a full pathname). The first component of the pathname pointed to by the ioNamePtr field in the parameter block is used as the volume name and UTDetermineVol attempts to find the volume by name.
  1752. 2    Reference number - The ioVRefNum field in the parameter block is used to determine the volume. If ioVRefNum is zero, UTDetermineVol attempts to find the default volume (if the default volume is set up). If ioVRefNum is positive, UTDetermineVol attempts to find the volume by drive number. If ioVRefNum is negative, UTDetermineVol first attempts to find the volume by volume reference number and it that fails, then UTDetermineVol attempts to find the volume by working directory reference number 
  1753. s    Warning:  The PBGetCatInfo and PBGetFInfo File Manager calls do not use the ioNamePtr field in a parameter block as an input when the ioFDirIndex field in a parameter block is non-zero. Before calling UTDetermineVol in these cases, you must save the value of ioNamePtr and set ioNamePtr to NULL so that UTDetermineVol will not attempt to determine the volume by full pathname. After calling UTDetermineVol, you must restore the original value in ioNamePtr. s
  1754. If the volume cannot be determined, UTDetermineVol will fail with paramErr and the field referred to by the status parameter will be set to dtmvError.
  1755. Result codes
  1756. noErr    0    No error
  1757. paramErr    -50    The parameter block does not refer to a 
  1758.         mounted volume
  1759. UTParsePathname
  1760. Use UTParsePathname to detemine if a pathname is valid, if the pathname is a partial or full pathname, and the volume name length if the pathname is a full pathname.
  1761. pascal OSErr UTParsePathname(short *volNamelength, StringPtr namePtr);
  1762. volNamelength    Contains a pointer to a short. If the pathname is a full pathname, UTParsePathname places the length of the volume name into the field referred to by this parameter. If the pathname is a partial pathname, UTParsePathname places zero into the field referred to by this parameter.
  1763. namePtr    Contains a pointer to a Pascal string that specifies the pathname.
  1764. UTParsePathname determines if namePtr points to a valid pathname, if the pathname is a partial or full pathname, and the volume name length if the pathname is a full pathname. See Inside Macintosh: Files for the definition of a full and partial pathnames. UTParsePathname cannot parse pathnames with more than 31 consecutive colon separators.
  1765. Result codes
  1766. noErr    0    No error
  1767. bdNamErr    -37    namePtr is NULL, namePtr points to a zero 
  1768.         length string, the pathname doesn’t have correct 
  1769.         syntax, or pathname has more than 
  1770.         31 consecutive colon separators 
  1771. UTGetPathComponentName
  1772. Use UTGetPathComponentName to parse the components in a pathname.
  1773. pascal OSErr UTGetPathComponentName(ParsePathRecPtr parseRec);
  1774. parseRec    Contains a pointer to a ParsePathRec.
  1775. parseRec
  1776. Æ    namePtr    StringPtr    Contains a pointer to a Pascal string that 
  1777.             contains the pathname.
  1778. Æ    startOffset    short    Contains the offset into the pathname 
  1779.             where the parsing will begin. Offset 0 
  1780.             (not 1) is the first character of the 
  1781.             pathname.
  1782. ¨    componentLength    short    UTGetPathComponentName places the 
  1783.             length of the component into this field.
  1784. ¨    moreName    short    If there is no more pathname left after 
  1785.             the parse, UTGetPathComponentName 
  1786.             places zero into this field; otherwise, a 
  1787.             non-zero value is placed into this field.
  1788. ¨    foundDelimiter    short    If parsing stops because a delimiter (a 
  1789.             colon character) is found, 
  1790.             UTGetPathComponentName places a 
  1791.             non-zero value into this field; 
  1792.             otherwise, zero is placed into this field.
  1793. UTGetPathComponentName parses a pathname to get the individual components that make up the pathname.
  1794. The namePtr field in the ParsePathRec passed to UTGetPathComponentName must point to the pathname to parse. The startOffset field in the ParsePathRec tells UTGetPathComponentName where to start looking for a pathname component.
  1795. UTGetPathComponentName returns the length of the component at startOffset in the componentLength field of the ParsePathRec, indicates if the parse found the end of the pathname in the moreName field of the ParsePathRec, and indicates if the parse stopped because a delimiter character was found.
  1796. Result codes
  1797. noErr    0    No error
  1798. bdNamErr    -37    namePtr is NULL, namePtr points to a zero 
  1799.         length string, the pathname doesn’t have correct 
  1800.         syntax, or pathname has more than 
  1801.         31 consecutive colon separators 
  1802. UTGetBlock
  1803. Use UTGetBlock to get a cache block in the Macintosh volume cache.
  1804. pascal OSErr UTGetBlock(short refNum, void *log2PhyProc, 
  1805.                         unsigned long blockNum, short gbOption, 
  1806.                         Ptr *buffer);
  1807. refNum    Contains the file or volume reference number.
  1808. log2PhyProc    Contains a pointer to the logical to physical routine or NULL if refNum is a volume refererence number.
  1809. blockNum    Contains the logical block number of the file, or the physical block number of the volume.
  1810. gbOption    Contains the get block options. The option values you can pass are:
  1811.     gbDefault    read from disk if block is not found in the 
  1812.             cache
  1813.     gbRead    always read block from disk (forced read)
  1814.     gbExist    get block only if it is already in the cache as a 
  1815.             released block.
  1816.     gbNoRead    do not read block if it is not already in the 
  1817.             cache
  1818.     gbRelease    this option can be added to any of the other 
  1819.             gbOptions to release the block immediately 
  1820.             after getting it
  1821. buffer    Contains a pointer to a Ptr. UTGetBlock places the memory address of the cache block into the field referred to by this parameter.
  1822. UTGetBlock gets a cache block in the Macintosh volume cache and returns the address of the cache block in the buffer parameter. If refNum is a volume reference number, the blockNum is the physical block on the volume.  If refNum is a file reference number, then GetBlock calls the logical to physical routine to map blockNum, the logical file block, to a physical block on the volume.
  1823. UTGetBlock lets you specify several options with the gbOption parameter:
  1824. •    gbDefault should be used to get a disk block from the cache if it’s in the cache, or to bring a disk block into the cache if it isn’t in the cache.
  1825. •    gbRead should be used to force a block to be read from from the disk. For example, you’d use the gbRead option when handling a _Read call where the read-verify mode is requested by the caller.
  1826. •    gbNoRead should be used to get a cache block who’s contents will be completely overwritten.
  1827. •    gbExist should be used for getting a disk block which should already be in the cache as a released block. A free cache blocks is not found if gbExist is specified. If UTGetBlock with the gbExists option fails, use UTBlockInFQHashP to see if a physical block on the volume is in a free cache block in the Macintosh volume cache and if so, retry UTGetBlock with the gbDefault option.
  1828. •    gbRelease can be added to any of the other gbOptions to release the cache block immediately after getting it. This saves the step of releasing the block with UTReleaseBlock when you know you won’t be making another call to the Macintosh Volume Cache (which could reuse the cache block) before the cache block is used.
  1829. Important note: UTGetBlock can potentially return an internal positive error result code. Because the file system should never return a positive result, your foreign file system should return ioErr if it cannot recover gracefully from one of the positive error results.
  1830. s    Warning:  UTGetBlock may only be called from a foreign file system handling a request through its HFSCIProc. Attempts to call UTGetBlock outside of the context of the HFSCIProc will cause a system crash. s
  1831. Result codes
  1832. noErr    0    No error
  1833. chNoBuf    1    Cache internal error - no free cache buffers (all 
  1834.         reserved)
  1835. chInUse    2    Cache internal error - requested block is 
  1836.         reserved
  1837. chNotfound    3    Cache internal error - requested block was not 
  1838.         found (only if gbExist option)
  1839. ioErr    -36    Device I/O error
  1840. offLinErr    -65    Device was offline
  1841. notEnoughMemoryErr    -620    VM was not able to hold down enough 
  1842.         physical memory
  1843. UTReleaseBlock
  1844. Use UTReleaseBlock to release a reserved cache block.
  1845. pascal OSErr UTReleaseBlock(Ptr buffer, short rbOption);
  1846. buffer    Contains a pointer to the cache block to release.
  1847. rbOption    Contains the release block options. The option values you can pass are:
  1848.     rbDefault    release the cache block
  1849.     rbWrite    release, write the cache block to disk 
  1850.             (forced write) - this will also mark the cache 
  1851.             block clean
  1852.     rbTrash    mark the cache block trashed
  1853.     rbDirty    release and mark the cache block dirty 
  1854.             (deferred write)
  1855.     rbFree        mark the cache block free
  1856. UTReleaseBlock releases the reserved cache block specified in the buffer parameter. The rbOption parameter also allows UTReleaseBlock to write the cache block to disk, mark the cache block dirty, free the cache block, or trash the cache block.
  1857. Important note: UTReleaseBlock can potentially return an internal positive error result code. Because the file system should never return a positive result, your foreign file system should return ioErr if it cannot recover gracefully from the positive error result.
  1858. s    Warning:  UTReleaseBlock may only be called from a foreign file system handling a request through its HFSCIProc. Attempts to call UTReleaseBlock outside of the context of the HFSCIProc will cause a system crash. s
  1859. Result codes
  1860. noErr    0    No error
  1861. chNotInUse    1    Cache internal error - block being released was 
  1862.         not in use
  1863. ioErr    -36    Device I/O error (only if rbWrite option)
  1864. offLinErr    -65    Device was offline (only if rbWrite option)
  1865. notEnoughMemoryErr    -620    VM was not able to hold down enough 
  1866.         physical memory (only if rbWrite option)
  1867. UTFlushCache
  1868. Use UTFlushCache to flush all dirty cache blocks associated with a file or volume.
  1869. pascal OSErr UTFlushCache(short refNum, short fcOption);
  1870. refNum    Contains the file or volume reference number.
  1871. fcOption    Contains the flush block options. The option values you can pass are:
  1872.     fcDefault    flush the cache blocks
  1873.     fcTrash    mark the cache blocks trashed after flushing 
  1874.             them
  1875.     fcFree        mark the cache blocks free after flushing 
  1876.             them
  1877. UTFlushCache flushes all dirty blocks associated with the file or volume specified by refNum. The fcOption parameter also allows UTFlushCache to free the cache blocks, or trash the cache blocks after flushing them.
  1878. Note: When the fcTrash or fcFree option is used, all cache blocks associated with the file or volume are trashed or freed - not just those blocks that were dirty and flushed.
  1879. s    Warning:  UTFlushCache may only be called from a foreign file system handling a request through its HFSCIProc. Attempts to call UTFlushCache outside of the context of the HFSCIProc will cause a system crash. s
  1880. Result codes
  1881. noErr    0    No error
  1882. UTMarkDirty
  1883. Use UTMarkDirty to mark a cache block dirty.
  1884. pascal OSErr UTMarkDirty(Ptr buffer);
  1885. buffer    Contains a pointer to the cache block to mark dirty.
  1886. UTMarkDirty marks the specified cache block dirty.
  1887. Result codes
  1888. noErr    0    No error
  1889. UTTrashVolBlocks
  1890. Use UTTrashVolBlocks to trash all file and volume cache blocks associated with a volume.
  1891. pascal OSErr UTTrashVolBlocks(VCBPtr volCtrlBlockPtr);
  1892. volCtrlBlockPtr    Contains a VCBPtr that specifies the volume.
  1893. UTTrashVolBlocks trashes all file and volume cache blocks associated with the volume specified by volCtrlBlockPtr. That includes all released blocks and all free blocks. This routine must be used when a volume is unmounted or ejected.
  1894. Result codes
  1895. noErr    0    No error
  1896. UTTrashFileBlocks
  1897. Use UTTrashFileBlocks to trash all cache blocks associated with a file.
  1898. pascal OSErr UTTrashFileBlocks(VCBPtr volCtrlBlockPtr, 
  1899.                                 unsigned long fileNum)
  1900. volCtrlBlockPtr    Contains a VCBPtr that specifies the volume the file is on.
  1901. fileNum    Contains the file’s file number.
  1902. UTTrashFileBlocks trashes all cache blocks associated with the file specified by fileNum on the volume specified by volCtrlBlockPtr. This routine is typically used when a file is deleted.
  1903. Result codes
  1904. noErr    0    No error
  1905. UTTrashBlocks
  1906. Use UTTrashBlocks to trash or free a range of cache blocks associated with a file.
  1907. pascal OSErr UTTrashBlocks(unsigned long beginPosition, 
  1908.                             unsigned long byteCount, 
  1909.                             VCBPtr volCtrlBlockPtr, short fileRefNum, 
  1910.                             short tbOption)
  1911. beginPosition    Contains the beginning byte position of the blocks to trash. beginPosition must be a multiple of 512 bytes.
  1912. byteCount    Contains the number of bytes to trash. byteCount must be a multiple of 512 bytes.
  1913. volCtrlBlockPtr    Contains a VCBPtr that specifies the volume the file is on.
  1914. fileRefNum    Contains the file’s reference number.
  1915. tbOption    Contains the trash block options.  If zero, the range of blocks if trashed; If non-zero, the range of blocks is marked free.
  1916. UTTrashBlocks trashes or frees a range of cache blocks associated with the file specified by fileRefNum on the volume specified by volCtrlBlockPtr. The range is specified by beginPosition and byteCount. This routine is typically used when a file is shortened.
  1917. Result codes
  1918. noErr    0    No error
  1919. UTCacheReadIP
  1920. Use UTCacheReadIP to read a consecutive number of blocks into the caller’s buffer.
  1921. pascal OSErr UTCacheReadIP(void *log2PhyProc, 
  1922.                             unsigned long filePosition, 
  1923.                             Ptr ioBuffer, short fileRefNum, 
  1924.                             unsigned long reqCount, 
  1925.                             unsigned long *actCount, 
  1926.                             short cacheOption);
  1927. log2PhyProc    Contains a pointer to the logical to physical mapping routine.
  1928. filePosition    Contains the position in bytes to start reading from. This must fall on a 512-byte boundary (i.e., 0, 512, 1024, etc.).
  1929. ioBuffer    Contains a pointer to data buffer where the data will be read.
  1930. fileRefNum    Contains the file reference number.
  1931. reqCount    Contains the number of bytes to read. This must be a multiple of 512 bytes.
  1932. actCount    Contains a pointer to an unsigned long. UTCacheReadIP places the actual number of bytes read into the field referred to by this parameter .
  1933. cacheOption    Contains the cache options. The valid bits in the cacheOption parameter are:
  1934.     noCache    please don’t cache this read
  1935.     rdVerify    always read blocks from disk (forced read)
  1936. UTCacheReadIP lets you request a multiple-block read from a file through the file system cache mechanism. UTCacheReadIP always reads a contiguous range of blocks. The number of contiguous blocks actually read is determined by the log2PhyProc and is returned in actCount.
  1937. The cacheOption parameter lets you request that reads not be cached, or that reads always come from the disk. A foreign file system handling a _Read call can simply use the ioPosMode word from the caller’s parameter block for the cacheOption parameter.
  1938. Important note: UTCacheReadIP can potentially return an internal positive error result code. Because the file system should never return a positive result, your foreign file system should return ioErr if it cannot recover gracefully from one of the positive error results.
  1939. s    Warning:  UTCacheReadIP may only be called from a foreign file system handling a request through its HFSCIProc. Attempts to call UTCacheReadIP outside of the context of the HFSCIProc will cause a system crash. s
  1940. Result codes
  1941. noErr    0    No error
  1942. chNoBuf    1    Cache internal error - no free cache buffers (all 
  1943.         reserved)
  1944. chInUse    2    Cache internal error - requested block is 
  1945.         reserved
  1946. chNotfound    3    Cache internal error - requested block was not 
  1947.         found (only if gbExist option)
  1948. ioErr    -36    Device I/O error
  1949. offLinErr    -65    Device was offline
  1950. notEnoughMemoryErr    -620    VM was not able to hold down enough 
  1951.         physical memory
  1952. UTCacheWriteIP
  1953. Use UTCacheWriteIP to write a consecutive number of blocks from the caller’s buffer.
  1954. pascal OSErr UTCacheWriteIP(void *log2PhyProc, 
  1955.                             unsigned long filePosition, Ptr ioBuffer, 
  1956.                             short fileRefNum, unsigned long reqCount, 
  1957.                             unsigned long *actCount, 
  1958.                             short cacheOption);
  1959. log2PhyProc    Contains a pointer to the logical to physical mapping routine.
  1960. filePosition    Contains the position in bytes to start writing to. This must fall on a 512-byte boundary (i.e., 0, 512, 1024, etc.).
  1961. ioBuffer    Contains a pointer to data buffer containing the data.
  1962. fileRefNum    Contains the file reference number.
  1963. reqCount    Contains the number of bytes to write. This must be a multiple of 512 bytes.
  1964. actCount    Contains a pointer to an unsigned long. UTCacheWriteIP places the actual number of bytes written into the field referred to by this parameter .
  1965. cacheOption    Contains the cache options. The valid bits in the cacheOption parameter are:
  1966.     noCache    please don’t cache this write
  1967. UTCacheWriteIP lets you request a multiple-block write to a file through the file system cache mechanism. UTCacheWriteIP always writes a contiguous range of blocks. The number of contiguous blocks actually written is determined by the log2PhyProc and is returned in actCount.
  1968. The cacheOption parameter lets you request that writes not be cached. A foreign file system handling a _Write call can simply use the ioPosMode word from the caller’s parameter block for the cacheOption parameter.
  1969. Important note: UTCacheWriteIP can potentially return an internal positive error result code. Because the file system should never return a positive result, your foreign file system should return ioErr if it cannot recover gracefully from one of the positive error results.
  1970. s    Warning:  UTCacheWriteIP may only be called from a foreign file system handling a request through its HFSCIProc. Attempts to call UTCacheWriteIP outside of the context of the HFSCIProc will cause a system crash. s
  1971. Result codes
  1972. noErr    0    No error
  1973. chNoBuf    1    Cache internal error - no free cache buffers (all 
  1974.         reserved)
  1975. chInUse    2    Cache internal error - requested block is 
  1976.         reserved
  1977. chNotfound    3    Cache internal error - requested block was not 
  1978.         found (only if gbExist option)
  1979. ioErr    -36    Device I/O error
  1980. offLinErr    -65    Device was offline
  1981. notEnoughMemoryErr    -620    VM was not able to hold down enough 
  1982.         physical memory
  1983. UTBlockInFQHashP
  1984. Use UTBlockInFQHashP to see if a physical block on the volume is in a free cache block in the Macintosh volume cache.
  1985. pascal OSErr UTBlockInFQHashP(short vRefNum, unsigned long diskBlock);
  1986. vRefNum    Contains the volume reference number.
  1987. diskBlock    Contains the physical block number of the volume.
  1988. UTBlockInFQHashP lets you check to see if the specified block is in a free cache block in the Macintosh volume cache. UTBlockInFQHashP returns noErr if the disk block data is in a free cache block. A result of chNotfound indicates that the disk block is not in the free block queue (although it may in the cache as a reserved or released block).
  1989. Result codes
  1990. noErr    0    No error
  1991. chNotfound    3    Requested block was not found in the free 
  1992.         block queue
  1993. 4    The Disk Initialization Component Interface
  1994. About this chapter
  1995. This chapter describes the Disk Initialization Package component interface, the data structures used by the Disk Initialization Package component interface, and the routines your foreign file system must provide to the Disk Initialization Package component interface.
  1996. To use this chapter, you should be familiar with the information in the chapter “The File System Manager” in this document, the information in Inside Macintosh: Files, the information in Inside Macintosh: Devices, and the information in the Technical Note “What Your Sony Drives for You”.
  1997. About the Disk Initialization Package component interface
  1998. The Disk Initialization Package component interface allows a foreign file system to process Disk Initialization Package requests and allows a foreign file system to describe its disk initialization services to the File System Manager. Whenever a Disk Initialization Package request is made, the File System Manager will call the foreign file system through the Disk Initialization Package component interface to get additional information and request specific actions.
  1999. Using the Disk Initialization Package component interface
  2000. This section describes
  2001. •    the Disk Initialization Package Component Interface record
  2002. •    the Disk Initialization Package Component Interface request processing function and its function selectors
  2003. The Disk Initialization Package Component Interface Record
  2004. The Disk Initialization Package component interface record in an File System Descriptor record lets the foreign file system tell the Disk Initialization Package component interface how to dispatch Disk Initialization Package requests to the foreign file system. It tells the Disk Initialization Package component interface where the routine to handle Disk Initialization Package requests is in memory, the maximum length of volume names the foreign file system can accept, and the disk block size of your foreign file system’s volume format. The data type DICIRec defines the Disk Initialization Package component interface record.
  2005. struct DICIRec {
  2006. long    compInterfMask;    /* component flags */
  2007. DICIUPP    compInterfProc;    /* pointer to request 
  2008.                 processing code */
  2009. short    maxVolNameLength;    /* maximum length of your 
  2010.                 volume name */
  2011. unsigned short    blockSize;    /* your file system's block 
  2012.                 size */
  2013. long    reserved3;    /* --reserved, must be 
  2014.                 zero-- */
  2015. long    reserved2;    /* --reserved, must be 
  2016.                 zero-- */
  2017. long    reserved1;    /* --reserved, must be 
  2018.                 zero-- */
  2019. };
  2020. typedef struct DICIRec DICIRec;
  2021. typedef DICIRec *DICIRecPtr;
  2022. Field descriptions
  2023. compInterfMask    Contains the Disk Initialization Package component interface dispatch mask. Currently the following bits are defined:
  2024. Bit        Meaning
  2025. 0    diCILiveBit    If set, this file system is a 
  2026.         candidate for the current 
  2027.         formatting operation. This bit is 
  2028.         maintained by the Disk 
  2029.         Initialization Package 
  2030.         component interface.
  2031. 1-15        Reserved.
  2032. 16    diCIDoesSparingBit    Set this bit if the foreign file 
  2033.         system supports bad block disk 
  2034.         sparing.
  2035. 17    diCIHasMultiVolTypesBit    Set this bit if the foreign file 
  2036.         system supports more than one 
  2037.         volume type.
  2038. 18    diCIHasExtFormatParamsBit    Set this bit if the foreign file 
  2039.         system uses extended format 
  2040.         parameters.
  2041. 19-23    Reserved.
  2042. 24-29    Reserved for the File System 
  2043.         Manager’s use.
  2044. 30    fsmComponentBusyBit    If set, the FSM component 
  2045.         interface is busy (i.e., one or 
  2046.         more requests are outstanding). 
  2047.         This bit is maintained by the 
  2048.         component and used by the File 
  2049.         System Manager to control the 
  2050.         use of the SetFSInfo File 
  2051.         System Manager service request.
  2052. 31    fsmComponentEnableBit    If set, the component may begin 
  2053.         dispatching requests to the foreign 
  2054.         file system. The foreign file 
  2055.         system should set this bit with 
  2056.         the SetFSInfo File System 
  2057.         Manager service request once it  is 
  2058.         ready to receive requests.
  2059. compInterfProc    Contains a pointer to the foreign file system’s Disk Initialization Package component interface request processing function.
  2060. maxVolNameLength    Contains the maximum length of volume names the foreign file system can accept.
  2061. blockSize    Contains the size of the foreign file system disk block in bytes.
  2062. The Disk Initialization Package Component Interface Request Processing Function
  2063. The Disk Initialization Package Component Interface request processing function pointed to by compInterfProc in a DICIRec is called by the File System Manager to handle Disk Initialization Package requests. The Disk Initialization Package Component Interface request processing function must have the following form.
  2064. pascal OSErr DICIProc(short whatFunction, void *paramBlock, 
  2065.                         void *fsdGlobalPtr);
  2066. whatFunction    Contains a selector number which indicates what operation the foreign file system must perform.
  2067. paramBlock    Contains a pointer to the parameter block passed to the Disk Initialization Package component interface request processing function. The contents of the parameter block are specific to the selector number passed.
  2068. fsdGlobalPtr    Contains a pointer to the foreign file system’s optional global data area.
  2069. When the foreign file system’s DICIProc is called, it is passed a function selector number which specifies the operation to perform, a pointer to a buffer containing any additional parameters needed to process the operation, and a pointer to the foreign file system’s global data area. The currently defined messages are listed in Table 4-1.
  2070. Table 4-1.    Disk Initialization Package Component Interface Function Selectors
  2071. Message    Purpose
  2072. diCILoad    1    Load the disk initialization code and data resources (if they are not loaded or purged) and make them unpurgable.    
  2073. diCIUnload    2    Make the disk initialization code and data resources purgable.    
  2074. diCIEvaluateSizeChoices    3    Determine if the foreign file system can initialize a disk in the specified drive.    
  2075. diCIExtendedZero    4    Initialize a disk (write an empty volume directory).    
  2076. diCIValidateVolName    5    Determine if a volume name is valid.    
  2077. diCIGetVolTypeInfo    6    If the foreign file system supports more than one volume type, provide a list of those volume types.    
  2078. diCIGetFormatString    7    Supply strings used to build the Format pop-up menu and help balloons used in the disk initialization dialog box.    
  2079. diCIGetExtFormatParams    8    Query the user (or another part of the system) for additional formatting information beyond that supplied by the disk initialization dialog box provided by the Disk Initialization Package.    
  2080. How the foreign file system’s DICIProc should handle each operation and what result codes should be returned are described in the following sections.
  2081. Note: The DICIProc cannot be called at interrupt time. Thus, it may make Memory Manager requests and synchronous operating system requests.
  2082. diCILoad
  2083. The diCILoad function selector tells the foreign file system to load the disk initialization code and data resources (if they are not loaded or purged) and make them unpurgable. The paramBlock parameter is not used with the diCILoad function selector.
  2084. Result codes
  2085. noErr    0    No error
  2086. any of the result codes returned by the Resource Manager, GetFSInfo, or SetFSInfo
  2087. diCIUnload
  2088. The diCIUnload function selector tells the foreign file system to make the disk initialization code and data resources purgable. The paramBlock parameter is not used with the diCIUnload function selector.
  2089. Result codes
  2090. noErr    0    No error
  2091. diCIEvaluateSizeChoices
  2092. The diCIEvaluateSizeChoices function selector allows a foreign file system to determine if it can initialize a disk in the specified drive. If the disk drive can format disks in more than one size, the foreign file system indicates what sizes it can support and the preferred size. The paramBlock parameter points to a DICIEvaluateSizeRec record.
  2093. DICIEvaluateSizeRec
  2094. ¨    defaultSizeIndex    short    The foreign file system returns the index 
  2095.             number of the preferred or default SizeListRec 
  2096.             in this field; the first SizeListRec is at index 
  2097.             position 1. If none of the SizeListRec records 
  2098.             contain a valid size choice for the foreign file 
  2099.             system, return zero.
  2100. Æ    numSizeEntries    short    Contains the number of SizeListRec records in 
  2101.             the array pointed to by sizeListPtr.
  2102. Æ    driveNumber    short    Contains the drive number.
  2103. Æ    sizeListPtr    SizeListRecPtr    Contains a pointer to an array of 
  2104.             SizeListRec records.
  2105. Æ    sectorSize    unsigned short    Contains the number of bytes per sector 
  2106.             (sectors may not be the same size as blocks 
  2107.             used by a foreign file system). Use this value 
  2108.             to help determine if the foreign file system 
  2109.             can use disks mounted on this drive.
  2110. The sizeListPtr field in the DICIEvaluateSizeRec points to an array of SizeListRec records.
  2111. SizeListRec
  2112. ¨    sizeListFlags    short    The foreign file system returns the size list 
  2113.             flags in this field. All bits are currently reserved 
  2114.             except:
  2115.                 diCISizeListOKBit    Set this bit if the size 
  2116.                             specified in sizeEntry 
  2117.                             can be used by this 
  2118.                             foreign file system.
  2119. Æ    sizeEntry    FormatListRec    Contains a FormatListRec which specifies a 
  2120.             possible size of the drive.
  2121. The sizeEntry field in a SizeListRec is a FormatListRec.
  2122. FormatListRec
  2123. Æ    volSize    unsigned long    Contains the disk capacity in disk sectors 
  2124.             (sectors may not be the same size as blocks 
  2125.             used by a foreign file system).
  2126. Æ    formatFlags    SignedByte    Contains the format flags, density bit, and 
  2127.             number of disk sides. The sides, 
  2128.             sectorsPerTrack, and tracks are valid if 
  2129.             diCIFmtFlagsValidBit is set. The current disk 
  2130.             has this format if diCIFmtFlagsCurrentBit is 
  2131.             set. The disk is double-density (.SONY driver 
  2132.             only) if diCIFmtFlagsDoubleDensityBit is set. 
  2133.             The low nibble of the byte contains the number 
  2134.             of disk sides.                
  2135. Æ    sectorsPerTrack    SignedByte    Contains the average number of sectors per 
  2136.             track.
  2137. Æ    tracks    unsigned short    Contains the number of disk tracks.
  2138. The array of SizeListRec records is built from information obtained from the disk driver. Specifically, the File System Manager obtains the SizeListRec records by calling the disk driver’s _Status function with csCode set to Return Format List (6). If the disk driver does not support the Return Format List request, a single SizeListRec is constructed from the information in the drive queue element.
  2139. The foreign file system must index through the array of SizeListRec records. The number of elements in the array is indicated by numSizeEntries. If the foreign file system can format the disk using the size specified by a particular SizeListRec, it sets the diCISizeListOKBit in the SizeListRec’s sizeListFlags field. SizeListRec records usable by the foreign file system are shown in the Format pop-up menu in the disk initialization dialog box.
  2140. The index of the preferred SizeListRec is returned in the DICIEvaluateSizeRec record’s defaultSizeIndex field where defaultSizeIndex is in the range 1 to numSizeEntries. This is the menu item shown in the Format pop-up menu in the disk initialization dialog box if the current disk is already owned by this foreign file system.
  2141. Result codes
  2142. noErr    0    No error
  2143. diCIExtendedZero
  2144. The diCIExtendedZero function selector allows a foreign file system to initialize a disk. The paramBlock parameter points to a DICIExtendedZeroRec record.
  2145. DICIExtendedZeroRec
  2146. Æ    driveNumber    short    Contains the drive number of the device which 
  2147.             should be initialized with an empty volume 
  2148.             directory structure.
  2149. Æ    volNamePtr    StringPtr    Contains a pointer to the name that the volume 
  2150.             should be given.
  2151. Æ    fsid    short    Contains the target file system ID.
  2152. Æ    volTypeSelector    short    Contains the volume type selector if the foreign 
  2153.             file system supports more than one volume 
  2154.             type (diCIHasMultiVolTypesBit is set in 
  2155.             the compInterfMask field of the DICIRec).
  2156. Æ    numDefectBlocks    unsigned short    Contains the number of bad disk blocks or 
  2157.             zero. The block size is the size specified in the 
  2158.             blockSize field of the DICIRec.
  2159. Æ    defectListSize    unsigned short    Contains the size of the defect list buffer if 
  2160.             numDefectBlocks is not zero. For example, if 
  2161.             the volume size is 800K and your file system’s 
  2162.             block size is 1024 bytes, then defectListSize = 
  2163.             100 (800 bits = 100 bytes) and the defect list 
  2164.             buffer is 100 bytes in size.
  2165. Æ    defectListPtr    Ptr    Contains a pointer to the defect list buffer if 
  2166.             numDefectBlocks is not zero. The buffer 
  2167.             contains a bitmap of the disk blocks. A zero bit
  2168.             means the block is good, and a one bit means 
  2169.             the block is defective. This buffer is allocated 
  2170.             by the Disk initialization Package and is 
  2171.             released by the Disk initialization Package after 
  2172.             returning from this request.
  2173. Æ    volSize    unsigned short    Contains the size of the volume in disk sectors 
  2174.             (sectors may not be the same size as blocks 
  2175.             used by a foreign file system).
  2176. Æ    sectorSize    unsigned short    Contains the number of bytes per disk sector 
  2177.             (sectors may not be the same size as blocks 
  2178.             used by a foreign file system).
  2179. Æ    extendedInfoPtr    Ptr    Contains a pointer to the foreign file system’s 
  2180.             extended formatting information (if 
  2181.             diCIHasExtFormatParamsBit is set in the 
  2182.             compInterfMask field of the DICIRec), or nil.
  2183. The foreign file system must initialize the disk specified by driveNumber.
  2184. If the foreign file system has set diCIHasMultiVolTypesBit in the compInterfMask field of the DICIRec indicating that it supports multiple volume formats, the volume type selected is in volTypeSelector.
  2185. If the foreign file system has set diCIDoesSparingBit in the compInterfMask field of the DICIRec, it can use the information in numDefectBlocks, defectListSize, and defectListPtr to perform bad block sparing.
  2186. Result codes
  2187. noErr    0    No error
  2188. diCICriticalSectorBadErr    20    Disk cannot be spared; sectors critical to the 
  2189.         volume format are bad
  2190. diCISparingFailedErr    21    Disk cannot be spared; general error
  2191. diCITooManyBadSectorsErr    22    Disk cannot be spared; too many bad 
  2192.         sectors were found
  2193. diCIUnknownVolTypeErr    23    The volume type passed is not supported
  2194. diCINoExtendInfoErr    27    extendedInfoPtr was required but nil was 
  2195.         passed
  2196. paramErr    -50    The file system ID passed does not belong to 
  2197.         this foreign file system
  2198. diCIValidateVolName
  2199. The diCIValidateVolName function selector allows a foreign file system to determine if a volume name is valid. The paramBlock parameter points to a DICIValidateVolNameRec record.
  2200. DICIValidateVolNameRec
  2201. Æ    theChar    char    Contains the character to validate.
  2202. ¨    hasMessageBuffer    Boolean    The foreign file system returns true in this field 
  2203.             if it is providing its own alert message when an 
  2204.             illegal character is detected (messageBufferPtr 
  2205.             must not be nil).
  2206. Æ    charOffset    short    Contains the position of the current character 
  2207.             (the first character is at position 1).
  2208. ´    messageBufferPtr    StringPtr    If messageBufferPtr is not nil, then it points to 
  2209.             a Str255 buffer where the foreign file system 
  2210.             can return its own alert message when an illegal 
  2211.             character is detected.
  2212. Æ    charByteType    short    Contains the identity of theChar as a 1-byte 
  2213.             character or as the first or second byte of a 2-byte 
  2214.             character. The values can be:
  2215.                 smFirstByte    First byte of a 2-byte character
  2216.                 smSingleByte    1-byte character
  2217.                 smLastByte    Second byte of 2-byte character
  2218.             smFirstByte, smSingleByte, and smLastByte are 
  2219.             defined in Script.h.
  2220. Foreign file systems must be able to determine if a volume name is valid. The volume name must be validated:
  2221. •    as characters are entered into the name field in the disk initialization dialog box. This gives the foreign file system an opportunity to examine the syntax of the name as it is being assembled.
  2222. •    when the volume format selected in the Format pop-up menu in the disk initialization dialog box changes. This gives the foreign file system an opportunity to examine the syntax of the name already entered in the the name field.
  2223. •    when characters are pasted into the name field of the disk initialization dialog box. This gives the foreign file system an opportunity to examine the syntax of the characters added to the name.
  2224. If an illegal character is detected, the foreign file system must return paramErr.
  2225. If messageBufferPtr is not nil, then it points to Str255 buffer where the foreign file system can return its own alert message when an illegal character is detected. If an illegal character alert message is supplied, the foreign file system must return true in the hasMessageBuffer field. If hasMessageBuffer is left false, the Disk Initialization Package uses the default illegal character alert message. The messageBufferPtr field is set to nil (no buffer is provided) when the volume format selected in the Format pop-up menu in the disk initialization dialog box changes and when characters are pasted into the name field of the disk initialization dialog box.
  2226. The Disk Initialization Package ensures volume names are not too long.
  2227. Result codes
  2228. noErr    0    No error
  2229. paramErr    -50    The character passed is illegal in this foreign 
  2230.         file system’s volume names
  2231. diCIGetVolTypeInfo
  2232. The diCIGetVolTypeInfo function selector allows a foreign file system that supports more than one volume type to provide a list of those volume types. The paramBlock parameter points to a DICIGetVolTypeInfoRec record.
  2233. DICIGetVolTypeInfoRec
  2234. Æ    volSize    unsigned long    Contains the disk capacity in disk sectors 
  2235.             (sectors may not be the same size as blocks 
  2236.             used by a foreign file system).
  2237. Æ    sectorSize    unsigned short    Contains the number of bytes per sector 
  2238.             (sectors may not be the same size as blocks 
  2239.             used by a foreign file system).
  2240. ¨    numVolTypes    short    The foreign file system returns the number of 
  2241.             volume types it supports in this field.
  2242. ¨    volTypesBuffer[4]    Str32    The foreign file system returns the names of 
  2243.             volume types it supports in these string fields.
  2244. Some file systems support more than one volume type, for example Macintosh File System supports both HFS and MFS volume types. If your foreign file system supports more than one volume type, it should set the diCIHasMultiVolTypesBit in the compInterfMask field of its DICIRec. If the diCIHasMultiVolTypesBit is not set, the Disk Initialization Package Component Interface request processing function will not be called with the diCIGetVolTypeInfo function selector.
  2245. The volSize and sectorSize fields are provided to help the foreign file system determine which of its volume types can be used.
  2246. The foreign file system returns the number of volume types it supports in the numVolTypes field. Up to four volume types are allowed.
  2247. The name of each supported volume type is returned in one of the four volTypeBuffer string buffers. These strings are used, together with the file system name and disk size, to compose the menu item strings to be displayed in the disk initialization dialog’s Format pop-up menu. The order of the strings is important because the ordering number will be passed as the volTypeSelector to the foreign file system when it is called with the diCIExtendedZero function selector. The value of volTypeSelector is only meaningful to your file system as it is a direct mapping to the types returned by this function request in the volTypesBuffer string buffers.
  2248. Your foreign file system’s default volume type string must be returned in volTypesBuffer[1] for that volume type to be selected as the default in the Format pop-up menu in the disk initialization dialog box.
  2249. Your volume type information and the corresponding type selectors should be published in your foreign file system’s documentation so that specific volume types can be initialized programmatically by applications with the DIXZero function.
  2250. Result codes
  2251. noErr    0    No error
  2252. diCIGetFormatString
  2253. The diCIGetFormatString function selector allows a foreign file system to supply strings used to build the Format pop-up menu and help balloons used in the disk initialization dialog box. The paramBlock parameter points to a DICIGetFormatStringRec record.
  2254. DICIGetFormatStringRec
  2255. Æ    volSize    unsigned long    Contains the disk capacity in disk sectors 
  2256.             (sectors may not be the same size as blocks 
  2257.             used by a foreign file system).
  2258. Æ    sectorSize    unsigned short    Contains the number of bytes per sector 
  2259.             (sectors may not be the same size as blocks 
  2260.             used by a foreign file system).
  2261. Æ    volTypeSelector    short    Contains the volume type selector if the foreign 
  2262.             file system supports more than one volume 
  2263.             type (diCIHasMultiVolTypesBit is set in 
  2264.             the compInterfMask field of the DICIRec).
  2265. Æ    stringKind    short    Contains the kind of string requested. The 
  2266.             kinds are:
  2267.                 diCIAlternateFormatStr    get the alternate 
  2268.                     format string
  2269.                 diCISizePresentationStr    get the size 
  2270.                     presentation string
  2271. ¨    stringBuffer    Str255    The foreign file system returns the string 
  2272.             requested in this field.
  2273. A foreign file system can supply strings used to build the Format pop-up menu and help balloons used in the disk initialization dialog box. If the foreign file system doesn’t provide the string, it can return diCIUnknownDICallErr and Disk Initialization Package will use its default strings.
  2274. If stringKind is diCIAlternateFormatStr, the foreign file system can provide a string that will be used augment the help balloon displayed for a volume type in the Format pop-up menu in the disk initialization dialog box. For example, without the alternate format string, the balloon text for an Macintosh 800K disk reads “To erase the selected disk and change it to a Macintosh 800K disk, choose this item, then click Erase.” With the alternate format string “ (also known as a double-sided Macintosh disk)”, the balloon text for an Macintosh 800K disk reads “To erase the selected disk and change it to a Macintosh 800K disk (also known as a double-sided Macintosh disk), choose this item, then click Erase.”
  2275. If stringKind is diCISizePresentationStr, the foreign file system can provide a string that replaces the volume type in the Format pop-up menu in the disk initialization dialog box. For example, by supplying the size presentation string, the volume type string in the Format pop-up menu could be changed from “Macintosh 720K” to “Macintosh HFS Interchange Format”.
  2276. Result codes
  2277. noErr    0    No error
  2278. diCIUnknownDICallErr    25    The requested string isn’t provided by this 
  2279.         foreign file system
  2280. diCIGetExtFormatParams
  2281. The diCIGetExtFormatParams function selector allows a foreign file system a chance to query the user (or another part of the system) for additional formatting information beyond that supplied by the disk initialization dialog box provided by the Disk Initialization Package. The paramBlock parameter points to a DICIGetExtendedFormatRec record.
  2282. DICIGetExtendedFormatRec
  2283. Æ    driveNumber    short    Contains the drive number of the device to be 
  2284.             initialized.
  2285. Æ    volTypeSelector    short    Contains the volume type selector if the foreign 
  2286.             file system supports more than one volume 
  2287.             type (diCIHasMultiVolTypesBit is set in 
  2288.             the compInterfMask field of the DICIRec).
  2289. Æ    volSize    unsigned long    Contains the disk capacity in disk sectors 
  2290.             (sectors may not be the same size as blocks 
  2291.             used by a foreign file system).
  2292. Æ    sectorSize    unsigned short    Contains the number of bytes per sector 
  2293.             (sectors may not be the same size as blocks 
  2294.             used by a foreign file system).
  2295. Æ    fileSystemSpecPtr    FSSpecPtr    Contains a pointer to foreign file system’s 
  2296.             FSSpec.
  2297. ¨    extendedInfoPtr    Ptr    The foreign file system returns a pointer to the 
  2298.             extended formatting information in this field.
  2299. A foreign file system may need more information from the user (or another part of the system) than can be provided by the disk initialization dialog box. The diCIGetExtFormatParams function selector allows a foreign file system a chance to query the user for extended formatting information after the user selects the Erase or Initialize button in the disk initialization dialog box. The diCIGetExtFormatParams function selector is called if the diCIHasExtFormatParamsBit is set in the compInterfMask field of the foreign file system’s DICIRec.
  2300. When called with the diCIGetExtFormatParams function selector, the foreign file system should allocate memory (if it hasn’t done so when called with the diLoad function selector) for the extended formatting information structure, open its resource fork using the FSSpec passed in the fileSystemSpecPtr field, display one or more dialogs to collect the extended information, close its resource fork, and then return a pointer to the extended formatting information in the extendedInfoPtr field. When called with the diUnload function selector, the foreign file system should dispose of its extended formatting information structure.
  2301. Any dialogs displayed should contain both a “Continue” and a “Cancel” button with the “Continue” button as the default selection. If the “Continue” button is selected, noErr should be returned as the result along with the extended formatting information. If the “Cancel” button is selected, diCIUserCancelErr should be returned as the result.
  2302. The extended formatting information data structure used by your foreign file system should be documented so that application programs can pass the information programmatically in the DIXZero request.
  2303. Result codes
  2304. noErr    0    No error
  2305. diCIUserCancelErr    1    The “Cancel” button was selected by the user
  2306.  
  2307.  
  2308. Appendix A:    The Extended Disk Initialization Package
  2309. About this Appendix
  2310. This appendix documents three Disk Initialization Package functions not found in Inside Macintosh: Files.
  2311. Application Program Interface
  2312. The existing application program interface to the Disk Initialization Package as described in Inside Macintosh: Files will continue to be supported by the enhanced Disk Initialization Package.  Applications which wish to initialize only  Macintosh disks will continue to work and will require no changes. However, if an application wants to initialize non-Macintosh disks, it must use the new extended DIXFormat and DIXZero calls as described below.
  2313. Extended programmatic interfaces to media formatting and volume initialization functions are required such that applications may specify additional information for the overall formatting operation. This information corresponds to the new items in the user interface described in the previous section: file system type and disk size. The extended programmatic interface adds three new functions to the Disk Initialization Package called DIXFormat and DIXZero (for extended DIFormat and DIZero), and DIReformat.
  2314. Warning:  Applications should insure that the extended Disk Initialization Package functions are present before making the DIXFormat, DIXZero, or DIReformat calls. This is done by calling Gestalt with the gestaltFSAttr selector. The extended Disk Initialization Package functions is available if the Gestalt function returns a result of noErr and the gestaltHasExtendedDiskInitbit (bit 6) is set in the response parameter. Due to the nature of older versions of the Disk Initialization Package, making the extended requests when they are not available may cause a system crash.
  2315. Listing 5-1 illustrates how you use Gestalt to determine if the extended Disk Initialization Package functions are available.
  2316. Listing 5-1.  Testing for extended Disk Initialization Package functions
  2317. Boolean    HasExtendedDIFunctions(void)
  2318. {
  2319.     long response;
  2320.     
  2321.     if (Gestalt(gestaltFSAttr, &response) == noErr)
  2322.         return ((response & (1L << gestaltHasExtendedDiskInit)) != 0);
  2323.     else
  2324.         return (false);
  2325. }
  2326. DIXFormat
  2327. The DIXFormat function performs the same function as the DIFormat function except that drive size may be specified.
  2328. pascal OSErr DIXFormat(short drvNum, Boolean fmtFlag, 
  2329.                         unsigned long fmtArg, unsigned long *actSize);
  2330. drvNum    Contains the driver number of the drive to format.
  2331. fmtFlag    Contains a boolean value which specifies the meaning of the fmtArg paramter.
  2332. fmtArg    If fmtFlag is true, fmtArg specifies the actual value to be passed to the disk driver in the csParam field of the parameter block when the “format” _Control call is made to initialize the disk media. (The value is an index into the size list. For an explanation of appropriate values for this parameter, see the Technical Note “What Your Sony Drives For You”.)
  2333. If fmtFlag is false, fmtArg specifies the desired size of the media in number of 512-byte blocks. The disk driver is called to get possible sizes and the values in an to attempt to match the requested size. If more than one size list entry exists for the same size, the first entry in the list returned by the driver that best matches the fmtArg parameter will be used. For more information about the size list, see the Technical Note “What Your Sony Drives For You”. If the specified size is larger than the largest size in the size list returned by the driver, then the largest size will be used and that size is returned in actSize. If the specified size is smaller than the smallest size in the size list returned by the driver, then the smallest size will be used and that size is returned in actSize. For a specified value that is in between and without an exact match, the value closest to and smaller than the requested size is used.
  2334. actSize    Contains a pointer to an unsigned long. Upon completion of a successful formatting operation, DIXFormat places the actual size of the formatted media in number of 512-byte blocks into the field referred to by this parameter.
  2335. The formatting of file systems requiring specific media formats should be done by specifying those media formats explicitly and not by counting on disk size alone. Foreign file systems with specific media requirements should use the driver specific information in the size list or should make appropriate driver _Status calls for additional information when called upon to “evaluate the size list”.
  2336. As in DIFormat, DIXFormat does not unmount the volume. You have to unmount the volume before issuing this call if necessary. If the volume has not been unmounted, then DIXFormat will return volOnLinErr error.
  2337. Result codes
  2338. noErr    0    No error
  2339. volOnLinErr     -55    Volume is online
  2340. lastDskErr    -64    Last of the range of low-level disk errors
  2341. ...
  2342. firstDskErr    -84    First of the range of low-level disk errors
  2343. DIXZero
  2344. The DIXZero function performs the same function as the DIZero function except that the file system, format result, volume type, volume size and extended formatting information may be specified.
  2345. pascal OSErr DIXZero(short drvNum, ConstStr255Param volName, short fsid, 
  2346.                         short mediaStatus, short volTypeSelector, 
  2347.                         unsigned long volSize, void *extendedInfoPtr);
  2348. drvNum    Contains the driver number of the drive to initialize.
  2349. volName    Contains a pointer to a Pascal string which specifies the name of the volume.
  2350. fsid    Contains the ID of the file system whose format should be written to the disk. The file system ID can be obtained using the File System Manager GetFSInfo function.
  2351. mediaStatus    Contains a flag to indicate the status of the disk media. Its value is the result code returned from the DIVerify function. If mediaStatus is non-zero, then the disk contains bad sectors and needs to be spared. If the file system specified doesn’t support bad block sparing (the diCIDoesSparingBit in the compInterfMask field of the DICIRec is clear), the Disk Initialization Package will just return this value as the function result. If the file system supports bad block sparing, then the Disk Initialization Package will gather the defect list and pass it to the file system.
  2352. volTypeSelector    Contains the volume type selector if the foreign file system supports more than one volume type (diCIHasMultiVolTypesBit is set in the compInterfMask field of the file system’s DICIRec).
  2353. volSize    Contains the size in 512-byte blocks of the file system that should be written to the drive specified by drvNum. This is the size returned in the actSize field by DIXFormat - the amount of space usable by a file system on the specified drive as it is currently formatted. If the specified size doesn't match with the current disk format size, DIXZero will return diCIVolSizeMismatchErr.
  2354. fsParams    Contains a pointer to the foreign file system’s extended formatting information (if diCIHasExtFormatParamsBit is set in the compInterfMask field of the DICIRec), or nil.
  2355. As in DIZero, DIXZero does not unmount the volume but it will, however, mount the volume if the operation is successful. You have to unmount the volume before issuing this call if necessary. If the volume is mounted when DIZero or DIXZero is called, then a volOnLinErr error will be returned.
  2356. Result codes
  2357. noErr    0    No error
  2358. ioErr    -36    I/O error
  2359. paramErr    -50    Drive number specified is bad
  2360. volOnLinErr     -55    Volume is already online
  2361. nsDrvErr    -56    No such drive
  2362. lastDskErr    -64    Last of the range of low-level disk errors
  2363. ...
  2364. firstDskErr    -84    First of the range of low-level disk errors
  2365. memFullErr    -108    Not enough memory
  2366. DIReformat
  2367. The DIReformat function reformats disk volume.
  2368. pascal OSErr DIReformat(short drvNum, short fsid, 
  2369.                         ConstStr255Param volName,
  2370.                         ConstStr255Param msgText);
  2371. drvNum    Contains the driver number of the drive to format.
  2372. fsid    Contains the ID of the file system whose format should be written to the disk. The file system ID can be obtained using the File System Manager GetFSInfo function.
  2373. volName    Contains a pointer to a Pascal string which specifies the name of the volume.
  2374. msgText    Contains a pointer to a Pascal string which specifies the explanatory text to be displayed in the disk initialization dialog box.
  2375. In the past, reformatting disk was accomplished by calling the DIBadMount function with the high word of the evtMessage parameter set to noErr and the explanatory text was set with the ParamText function. The DIReformat function provides the caller the ability to provide the explanatory text, the default file system ID, and the default name for the reformatted disk.
  2376. Note:  The volume in the drive specified by drvNum must be mounted when calling DIReformat .
  2377. Result codes
  2378. noErr    0    No error
  2379. diCINoMessageTextErr    28    msgText was not provided
  2380. paramErr    -50    Drive number specified is bad
  2381. nsDrvErr    -56    No such drive
  2382. lastDskErr    -64    Last of the range of low-level disk errors
  2383. ...
  2384. firstDskErr    -84    First of the range of low-level disk errors
  2385. memFullErr    -108    Not enough memory
  2386.  
  2387.  
  2388. Appendix B:    Additional File Manager Routines
  2389. About this Appendix 
  2390. This appendix documents two File Manager routines that are not in Inside Macintosh: Files but must be documented for foreign file systems.
  2391. Application Program Interface
  2392. The following two functions, PBHUnmountVol and PBGetXCatInfo are not documented in Inside Macintosh: Files. Foreign file systems must respond correctly to PBHUnmountVol and may want to support PBGetXCatInfo. Applications may use PBGetXCatInfo, but must never call PBHUnmountVol.
  2393. s    Warning: PBHUnmountVol is reserved for use only by the Macintosh operating system. The operating system uses PBHUnmountVol to unconditionally unmount volumes before system shutdown or restart. Applications should never call PBHUnmountVol because PBHUnmountVol can close files in use by other applications which can cause data loss or media corruption. s
  2394. PBHUnmountVol
  2395. The PBHUnmountVol function unconditionally unmounts a volume
  2396. pascal OSErr PBHUnmountVol(ParmBlkPtr paramBlock);
  2397. paramBlock    Contains a pointer to a ParamBlockRec.
  2398. ParamBlockRec
  2399. ¨    ioResult    OSErr    The result code of the function.
  2400. Æ    ioNamePtr    StringPtr    A pointer to a pathname.
  2401. Æ    ioVRefNum    short    A volume reference number, a working directory 
  2402.             reference number, drive number, or 0 for the 
  2403.             default volume.
  2404. The PBHUnmountVol function unconditionally unmounts the specified volume. All user files on the volume will be closed by the file system owning the volume.
  2405. The PBHUnmountVol function always executes synchronously.
  2406. s    Warning: PBHUnmountVol is reserved for use only by the Macintosh operating system. The operating system uses PBHUnmountVol to unconditionally unmount volumes before system shutdown or restart. Applications should never call PBHUnmountVol because PBHUnmountVol can close files in use by other applications which can cause data loss or media corruption. s
  2407. ASSEMBLY-LANGUAGE INFORMATION
  2408. The trap word for PBHUnmountVol is A20E.
  2409. Result codes
  2410. noErr    0    No error
  2411. nsvErr    –35    No such volume reference number
  2412. ioErr    –36    I/O error
  2413. bdNamErr    –37    Bad volume name
  2414. paramErr    –50    No default volume
  2415. nsDrvErr    –56    No such drive
  2416. extFSErr    –58    No file system claimed the volume
  2417. PBGetXCatInfo
  2418. You can use the PBGetXCatInfo function to get the short name (MS-DOS format name) and ProDOS information for files and directories.
  2419. pascal OSErr PBGetXCatInfoSync(XCInfoPBPtr paramBlock);
  2420. pascal OSErr PBGetXCatInfoAsync(XCInfoPBPtr paramBlock);
  2421. paramBlock    Contains a pointer to a XCInfoPBRec.
  2422. XCInfoPBRec
  2423. Æ    ioCompletion    StringPtr    Contains a pointer to PBGetXCatInfoAsync’s 
  2424.             completion routine.
  2425. ¨    ioResult    OSErr    PBGetXCatInfo places its result code into this 
  2426.             field.
  2427. Æ    ioNamePtr    StringPtr    Contains a pointer to the object name, or nil when 
  2428.             ioDirID specifies a directory that’s the object.
  2429. Æ    ioVRefNum    short    Contains a volume specification.
  2430. Æ    ioShortNamePtr    OSErr    Contains a pointer to a Pascal string buffer 
  2431.             (minimum 13 bytes). PBGetXCatInfo places 
  2432.             the short name into the field referred to by this 
  2433.             parameter. ioShortNamePtr cannot be nil.
  2434. ¨    ioPDType    short    PBGetXCatInfo places the ProDOS file type into 
  2435.             this field.
  2436. ¨    ioPDAuxType    long    PBGetXCatInfo places the ProDOS auxiliary 
  2437.             type into this field.
  2438. Æ    ioDirID    long    Contains a directory ID.
  2439. PBGetXCatInfo returns the short name (MS-DOS format name) and ProDOS file/auxiliary type information for files and directories on volumes that support this function. Volumes that support PBGetXCatInfo will have the bHasShortName bit set in the vMAttrib field returned by PBHGetVolParms.
  2440. The following data structure and inline glue code is needed for applications that wish to use PBGetXCatInfo.
  2441. struct XCInfoPBRec {
  2442. QElemPtr    qLink;
  2443. short    qType;
  2444. short    ioTrap;
  2445. Ptr    ioCmdAddr;
  2446. ProcPtr    ioCompletion;    /* A pointer to a completion 
  2447.                 routine */
  2448. OSErr    ioResult;        /* The result code of the 
  2449.                 function */
  2450. StringPtr    ioNamePtr;    /* Pointer to object name or 
  2451.                 nil */
  2452. short    ioVRefNum;    /* A volume specification */
  2453. long    filler1;
  2454. StringPtr    ioShortNamePtr;    /* A pointer to the short name 
  2455.                 string buffer - required! */
  2456. short    filler2;
  2457. short    ioPDType;    /* The ProDOS file type */
  2458. long    ioPDAuxType;    /* The ProDOS aux type */
  2459. long    filler[2];
  2460. long    ioDirID;    /* A directory ID */
  2461. };
  2462. typedef struct XCInfoPBRec XCInfoPBRec;
  2463. typedef XCInfoPBRec *XCInfoPBPtr;
  2464. #pragma parameter __D0 PBGetXCatInfoSync(__A0)
  2465. pascal OSErr PBGetXCatInfoSync(XCInfoPBPtr paramBlock)
  2466.                     = {0x703A,0xA260};
  2467. #pragma parameter __D0 PBGetXCatInfoAsync(__A0)
  2468. pascal OSErr PBGetXCatInfoAsync(XCInfoPBPtr paramBlock)
  2469.                     = {0x703A,0xA660};
  2470. For more information about short names and ProDOS file/auxiliary types, see Inside AppleTalk, second edition, Chapter 13 AppleTalk Filing Protocol, and the Apple II File Type Notes.
  2471. ASSEMBLY-LANGUAGE INFORMATION
  2472. The PBGetXCatInfo function uses routine selector $003A of HFSDispatch.
  2473. Result codes
  2474. noErr    0    No error
  2475. nsvErr    -35    No such volume
  2476. fnfErr    -43    File not found
  2477. paramErr    -50    Function not supported by volume
  2478. dirNFErr    -120    Directory not found
  2479.  
  2480.  
  2481. Appendix C:    File System Routine Table
  2482. About this Appendix
  2483. This appendix lists all File Manager routine and the select codes that your foreign file system’s HFSCIProc can be called with.
  2484. Routine
  2485. Name    Select
  2486. Code    Required    Volume
  2487. Attributes    Notes    
  2488. File Manager Traps                    
  2489. Open    $A000    •            
  2490. Close    $A001    •            
  2491. Read    $A002    •            
  2492. Write    $A003    •            
  2493. GetVolInfo       $A007    •            
  2494. Create       $A008    •            
  2495. Delete       $A009    •            
  2496. OpenRF       $A00A    •            
  2497. Rename       $A00B    •            
  2498. GetFileInfo      $A00C    •            
  2499. SetFileInfo      $A00D    •            
  2500. UnmountVol       $A00E    •            
  2501. MountVol     $A00F    •            
  2502. Allocate     $A010    •            
  2503. GetEOF       $A011    •            
  2504. SetEOF       $A012    •            
  2505. FlushVol     $A013    •            
  2506. GetVol       $A014                
  2507. SetVol       $A015                
  2508. FInitQueue       $A016            Never passed to foreign file systems.    
  2509. Eject    $A017    •            
  2510. GetFPos      $A018    •            
  2511. Offline    $A035    •            
  2512. SetFilLock     $A041    •            
  2513. RstFilLock     $A042    •            
  2514. SetFilType     $A043    •        This call is obsolete, but it does get passed to foreign file systems. You should return paramErr.    
  2515. SetFPos    $A044    •            
  2516. FlushFile    $A045    •            
  2517. HFS Calls                    
  2518. HOpen    $A200    •            
  2519. HGetVInfo    $A207    •            
  2520. HCreate      $A208    •            
  2521. HDelete      $A209    •            
  2522. HOpenRF      $A20A    •            
  2523. HRename      $A20B    •            
  2524. HGetFileInfo     $A20C    •            
  2525. HSetFileInfo     $A20D    •            
  2526. HUnmountVol    $A20E    •        Warning: reserved for system use only at system shutdown or restart! HUnmount unmounts a volume, even if files are open on the volume. The foreign file system should flush and close all open files before unmounting the volume.    
  2527. AllocContig      $A210    •            
  2528. HGetVol      $A214                
  2529. HSetVol      $A215                
  2530. HSetFLock    $A241    •            
  2531. HRstFLock    $A242    •            
  2532. HFS Dispatch Calls                    
  2533. OpenWD    $0001    •            
  2534. CloseWD    $0002                
  2535. CatMove    $0005    •            
  2536. DirCreate     $0006    •            
  2537. GetWDInfo     $0007                
  2538. GetFCBInfo    $0008    •            
  2539. GetCatInfo    $0009    •            
  2540. SetCatInfo    $000A    •            
  2541. SetVolInfo    $000B    •            
  2542. LockRng    $0010    •            
  2543. UnlockRng     $0011    •            
  2544. CreateFileIDRef    $0014        bHasFileIDs        
  2545. DeleteFileIDRef    $0015        bHasFileIDs        
  2546. ResolveFileIDRef     $0016        bHasFileIDs        
  2547. ExchangeFiles     $0017        bHasFileIDs        
  2548. CatSearch     $0018        bHasCatSearch        
  2549. OpenDF    $001A            Never passed to foreign file systems. The foreign file system will only see Open and HOpen.    
  2550. MakeFSSpec    $001B            If your foreign file system doesn't handle MakeFSSpec, the Macintosh file system will make the FSSpec by determining the real vRefNum and real parent dirID, and then indexing through the parent directory until a matching name is found.  This can be *very* slow if the directory has a lot of entries or if your foreign file system implementation of GetCatInfo is slow. If you don’t support MakeFSSpec, return paramErr.    
  2551. Desktop Manager Calls                    
  2552. DTGetPath    $0020        bHasDesktopMgr    The returned ioDTRefNum must be a file reference number (a FCB must be used).    
  2553. DTCloseDown    $0021        bHasDesktopMgr        
  2554. DTAddIcon     $0022        bHasDesktopMgr        
  2555. DTGetIcon     $0023        bHasDesktopMgr        
  2556. DTGetIconInfo     $0024        bHasDesktopMgr        
  2557. DTAddAPPL     $0025        bHasDesktopMgr        
  2558. DTRemoveAPPL    $0026        bHasDesktopMgr        
  2559. DTGetAPPL     $0027        bHasDesktopMgr        
  2560. DTSetComment    $0028        bHasDesktopMgr        
  2561. DTRemoveComment    $0029        bHasDesktopMgr        
  2562. DTGetComment    $002A        bHasDesktopMgr        
  2563. DTFlush    $002B        bHasDesktopMgr    Do nothing (noErr) on remote shared volumes.    
  2564. DTReset    $002C        bHasDesktopMgr    Do nothing (noErr) on remote shared volumes.    
  2565. DTGetInfo     $002D        bHasDesktopMgr    Return paramErr on remote shared volumes.    
  2566. DTOpenInform    $002E        bHasDesktopMgr    The returned ioDTRefNum must be a file reference number (a FCB must be used). Return paramErr on remote shared volumes.    
  2567. DTDelete    $002F        bHasDesktopMgr    Return paramErr on remote shared volumes.    
  2568.  
  2569. AppleShare Calls                    
  2570. GetVolParms    $0030    • (see Note)        GetVolParms is required if you want to support any of the calls that require a volume attribute bit.    
  2571. GetLogInInfo    $0031        bAccessCntl        
  2572. GetDirAccess    $0032        bAccessCntl        
  2573. SetDirAccess    $0033        bAccessCntl        
  2574. MapID     $0034        bAccessCntl        
  2575. MapName    $0035        bAccessCntl        
  2576. CopyFile    $0036        bHasCopyFile        
  2577. MoveRename    $0037        bHasMoveRename        
  2578. OpenDeny    $0038        bHasOpenDeny        
  2579. OpenRFDeny    $0039        bHasOpenDeny        
  2580. GetXCatInfo    $003A        bHasShortName        
  2581. GetVolMountInfoSize    $003F                
  2582. GetVolMountInfo    $0040                
  2583. VolumeMount    $0041                
  2584. Share    $0042            Handled by AppleShare or File Sharing server.    
  2585. UnShare    $0043            Handled by AppleShare or File Sharing server.    
  2586. GetUGEntry    $0044            Handled by AppleShare or File Sharing server.    
  2587. GetForeignPrivs    $0060                
  2588. SetForeignPrivs    $0061                
  2589.  
  2590.  
  2591.  
  2592. Appendix D:    File System Manager Questions and Answers
  2593. About this Appendix
  2594. This appendix contains a bunch of questions and answers gathered by Developer Support that will be useful to developers of foreign file systems.
  2595. Questions and Answers
  2596. Q:    If my foreign file system doesn’t support one of the non-required HFSDispatch select codes, what should it return?
  2597. A:    The foreign file system should return paramErr (-50) if it doesn’t support one of the non-required HFSDispatch select codes.
  2598.  
  2599. Q:    I’m implementing the Desktop Manager calls. How big can icons get?
  2600. A:    Apple’s Desktop Manager allows icons to be up to 4500 bytes, you should too.
  2601.  
  2602. Q:    What fields in an FCBRec can be used by a foreign file system for its own purposes?
  2603. A:    See Chapter 3, The File System Utility Routines, of the Guide to the File System Manager. It tells what fields can be used by your foreign file system and tells how those fields are used by the HFS file system.
  2604.  
  2605. Q:    What are the catalog node ID (CNID) numbers below fsUsrCNID (16) used for?
  2606. A:    CNID 1 is reserved for the parent ID of the root directory (fsRtParID) and CNID 2 is reserved for the directory ID of the root directory (fsRtDirID).  On HFS volumes, 3 is used for the extents file, 4 is used for the catalog file, and 5 is used for the bad allocation block file. Your foreign file system can use CNIDs 5 through 15 for whatever purposes it needs.
  2607.  
  2608. When _UnmountVol is called, the File Manager checks to see if there are any open files on that volume with a file number (fcbFlNm in the FCBRec) of fsUsrCNID or greater.  If so, the File Manager does not pass the _UnmountVol request on to the file system that owns the volume and a result of fBsyErr is returned to the caller. You can use CNIDs 5 through 15 for files opened by your foreign file system that should not prevent _UnmountVol from succeeding (for example, you should use a CNID below fsUsrCNID for the file number in FCBRecs used for the Desktop Manager DTGetPath or DTOpenInform routines).
  2609.  
  2610. Q:    What are the advantages of supporting the Desktop Manager select codes?
  2611. A:    If you don’t support the Desktop Manager select codes, the Finder will attempt to create a Desktop file to keep track of application mappings and icons. The advantages of the Desktop Manager over the Desktop file are:
  2612. •    There is a documented interface for the Desktop Manager functions that developers can use.
  2613. •    The Desktop Manager can be used on shared volumes. The Desktop file, since it is simply a resource file, can only allow write access to one user or process - it cannot be shared. Under System 7, that process is the Finder.
  2614. •    The Desktop Manager functions can be implemented by an external file system in the most efficient way possible for that particular file system.
  2615. •    The Desktop Manager doesn't have the file size limitations imposed by the Resource Manager; 2727 resources and approximately 16Mb of resource data.
  2616.  
  2617. Q:    How does information get removed from the Desktop file or Desktop Database?
  2618. A:    With both the Desktop file and the Desktop Manager database, icon data is not removed from the database unless the Desktop database or file is rebuilt from scratch. That's because the Finder (and file system for that matter) has no way of being notified when the last file of a given creator and type is removed from a volume. If the Finder removes an application (a file with type APPL), then the Finder attempts to remove the application mapping information for that copy of the application from the Desktop database or file.
  2619.  
  2620. Q:    We want to provide the shared desktop database environment. What minimal set of calls do we need to support for this?
  2621. A:    It really depends on how your file system is going to be used. Apple's read-only foreign file systems such as ISO 9660 let you open the desktop database, get info on it (all zeros are returned), and get comments on the root directory.  All other Desktop Manager routines return an error.  Apple's two read/write file systems that support the Desktop Manager, AppleShare and HFS, both support all of the original Desktop Manager calls (selectors $20 through $2A).  HFS supports the selectors $2B through $2F; DTFlush, DTReset, DTGetInfo, DTOpenInform, and DTDelete don't make sense in a shared environment.  So, I'd say you need to support selectors $20 through $2A and then return an appropriate error for the others. AppleShare returns noErr and does nothing for DTFlush and DTReset and returns paramErr for DTGetInfo, DTOpenInform, and DTDelete.
  2622.  
  2623. Q:    We do not necessarily want full AppleShare (AFP) access-control, but we need more information on foreign file privilege models.
  2624. A:    To be compatible with existing Macintosh applications, you must mimic the HFS file system's permission model. Inside Macintosh: Files describes how AppleShare does that on pages 2-17 and 2-18. If you want a more extensive permission model that AppleShare-aware applications can use, then you'll need to support the AppleShare HFSDispatch selectors and mimic AppleShare permissions. If you can't fit into the AppleShare model, you can come up with your own model and use PBGetForeignPrivs and PBSetForeignPrivs to manipulate your native privileges. However, you still must map those privileges to the HFS file system model. If you decide to use PBGetForeignPrivs and PBSetForeignPrivs, you'll use the creator type assigned to your foreign file system for your vMForeignPrivID number (the number you return for PBHGetVolParms requests).
  2625.  
  2626. Q:    What is needed for a foreign file system to support PBCatSearch?
  2627. A:    You'll need to support PBHGetVolParms so that you can indicate that you support CatSearch. It will be up to your foreign file system to come up with a fast way to search a volume’s catalog for matches. The Apple Developer Support sample code MoreFiles version 1.2 and later contains much of the code needed to implement CatSearch in the file Search.C.
  2628.  
  2629. Q:    FindFolder seems to make some assumption on volumes that support AppleShare (AFP) access-control. What are those assuptions?
  2630. A:    The folder manager assumes that user ID 0 is the guest user and user ID 1 is the administrator (owner) user and uses byte range locks on an empty data file as a semaphore to control access to individual trash folders on the volume. For more information, see Inside AppleTalk, second edition and the AppleTalk Filing Protocol Version 2.1 chapter of the AppleShare 3.0 Developer’s Kit.
  2631.  
  2632. Q:    How should I handle VolumeMount requests?
  2633. A:    VolumeMount requests are caught by the File System Manager before they are passed to the File Manager. FSM calls each installed foreign file system’s fileSystemCommProc with a ffsIDVolMountMessage. If the media type is not your foreign file system’s media type, you return extFSErr. If the media type is your foreign file system’s media type, you return noErr and the your HFSCIProc will be called with the VolumeMount select code.
  2634.  
  2635. When your HFSCIProc is called with the VolumeMount select code, your foreign file system should do everything needed to mount a volume. It should:
  2636. •    Allocate memory for a volume control block (VCB) with UTAllocateVCB.
  2637. •    Fill in the fields of the VCB.
  2638. •    Allocate memory for a drive queue element (DrvQEl) in the system heap.
  2639. •    Fill in the fields of the DrvQEl.
  2640. •    Call _AddDrive to add the DrvQEl to the drive queue (DrvQHdr).
  2641. •    Add the VCB to the VCB queue (VCBQHdr) with UTAddNewVCB.
  2642. •    Use PostEvent to post a diskInsertEvt event.
  2643.     The volume reference number you return to VolumeMount is the volume reference number returned by UTAddNewVCB.
  2644.  
  2645. After VolumeMount returns to the caller, the Event Manager will handle the diskInsertEvt event and will call your foreign file system with a _MountVol request. Since the volume is already mounted, your MountVol code only needs to return noErr.
  2646.  
  2647. Q:    Can I put up an additional user authentication dialog when my foreign file system gets a VolumeMount request?
  2648. A:    You put up an additional user authentication dialog if the caller of VolumeMount tells you it is safe to do that. To allow foreign file system to determine if it is safe, Apple has extended the VolMountInfoHeader record to include a flags word (the same flags word already in the AFPVolMountInfo record). By setting the volMountInteractBit (bit 15) in the flags word, the caller can tell your foreign file system that it is safe to use the Dialog Manager to put up your authentication dialog. In addition, if your foreign file system finds that the VolMountInfo record passed is usable but needs to be updated, it can set the volMountChangedBit (bit 14) in the flags word to tell the caller that it needs to update the VolMountInfo record using the PBGetVolMountInfoSize and PBGetVolMountInfo functions.
  2649.  
  2650. The Alias Manager has been updated to set the volMountInteractBit if the kARMNoUI rule is passed to the MatchAlias function, and to return the state of the volMountChangedBit in the needsUpdate parameter of the MatchAlias function and the wasChanged parameter the ResolveAlias function.
  2651.  
  2652. Here are the new constant definitions and data types you need:
  2653.     /* The new volume mount flags */
  2654. enum {
  2655.     volMountInteractBit = 15,    /* Input to VolumeMount: If 
  2656.                 set, it's OK for the file 
  2657.                 system to perform user 
  2658.                 interaction to mount the 
  2659.                 volume */
  2660.     volMountInteractMask = 0x8000,
  2661.  
  2662.     volMountChangedBit = 14,    /* Output from VoumeMount: If 
  2663.                 set, the volume was mounted, 
  2664.                 but the volume mounting 
  2665.                 information record needs to 
  2666.                 be updated. */
  2667.     volMountChangedMask = 0x4000,
  2668.  
  2669.     volMountFSReservedMask = 0x00ff, /* bits 0-7 are defined each 
  2670.                 file system's use */
  2671.     volMountSysReservedMask = 0xff00 /* bits 8-15 are reserved for 
  2672.                 Apple system use */
  2673. };
  2674.  
  2675. /* The new volume mount info record */
  2676. struct VolMountInfoHeader {
  2677.     short    length;    /* length of location data 
  2678.                 (including self) */
  2679.     VolumeType    media;    /* type of media.  Variable 
  2680.                 length data follows */
  2681.     short    flags;    /* flags */
  2682. };
  2683. typedef struct VolMountInfoHeader VolMountInfoHeader;
  2684. typedef VolMountInfoHeader *VolMountInfoPtr;
  2685. Q:    What is the correct time to put up an additional user authentication dialog when my foreign file system gets a VolumeMount request?
  2686. A:    The correct time to put up an additional user authentication dialog is when your foreign file system’s fileSystemCommProc gets the ffsIDVolMountMessage. You don’t want to wait until your HFSCIProc is called because at that time, you’re in the middle of a File Manager request and cannot do anything that might cause another File Manager request.
  2687.  
  2688. Q:    How do I register a VolumeMount media type?  How do I register a foreign privileges ID number?
  2689. A:    Use your file system ID number for your foreign privileges ID number and use the creator type that you registered for your file system ID number for the VolumMount media type. If for some reason, you need another VolumeMount media type or foreign privileges ID number, you can simply register another file system ID number. It will be up to you to document your file system ID number, foreign privileges ID number, and VolumeMount media type if you want developers to know about them. That’s keeping with Apple’s policy of keeping creator types, card ID numbers, ADEV ID numbers, etc. confidential.  If you decide to publish information specific to your file system, you should probably include header files for programmers and that’s where you can document your numbers.
  2690.  
  2691. Q:    Where are the constants for the new information I can get by calling Gestalt with the gestaltFSAttr selector?
  2692. A:    Right here:
  2693.     gestaltFSAttr = 'fs  ',    /* file system attributes */
  2694.  
  2695. gestaltFullExtFSDispatching = 0,    /* all HFSDispatch selectors 
  2696.                 are passed through to file 
  2697.                 systems */
  2698. gestaltHasFSSpecCalls = 1,    /* File Manager has FSSpec 
  2699.                 calls */
  2700. gestaltHasFileSystemManager = 2,    /* has the File System 
  2701.                 Manager */
  2702. gestaltFSMDoesDynamicLoad = 3,    /* File System Manager supports 
  2703.                 dynamic loading */
  2704. gestaltFSSupports4GBVols = 4,    /* file system supports 
  2705.                 4 gigabyte volumes */
  2706. gestaltFSSupports2TBVols = 5,    /* file system supports 
  2707.                 2 terabyte volumes */
  2708. gestaltHasExtendedDiskInit = 6,    /* has extended Disk 
  2709.                 Initialization calls */
  2710. Q:    What should I return when called with the GetVolParms HFSDispatch select code?
  2711. A:    Funny you should ask.  Here’s how GetVolParms looks from the file system side of things:
  2712. The GetVolParmsInfoBuffer Record from file systems implementing PBHGetVolParms:
  2713. Offset    Field    Meaning
  2714. 0    vMVersion    Version number of the GetVolParmsInfoBuffer 
  2715.         record you return.  Version 1 indicates you can 
  2716.         return the vMVersion through vMServerAdr 
  2717.         fields.  Version 2 indicates you can return the 
  2718.         vMVersion through vMForeignPrivID fields.  
  2719.         Note: You must return no more than ioReqCount 
  2720.         bytes to PBHGetVolParms requests.  Indicate the 
  2721.         actual number of bytes returned in ioActCount.
  2722. 2    vMAttrib    A 32-bit quantity that encodes information about 
  2723.         the volume attributes.
  2724. 6    vMLocalHand    If supplied, a handle to private data kept by the 
  2725.         Macintosh system for shared volumes while they 
  2726.         are mounted.  When you mount the volume, you 
  2727.         must allocate a handle to a 2-byte block of memory 
  2728.         in the system heap which is returned in 
  2729.         vMLocalHand.  When you unmount the volume, 
  2730.         dispose of the handle.  Set the bLocalWList bit in 
  2731.         the vMAttrib field to indicate that this field is valid.  
  2732.         See the description of bLocalWList for when you 
  2733.         should supply the handle.
  2734. 10    vMServerAdr    For file server volumes, this field contains the 
  2735.         AppleTalk internet address of the file server that 
  2736.         manages the volume.  An application can inspect 
  2737.         this field to tell which volumes belong to a 
  2738.         particular file server; the value of this field is 0 if 
  2739.         the volume does not belong to a file server.  If you 
  2740.         support PBHCopyFile, you must initialize this 
  2741.         field.
  2742.         The Finder uses this field to determine if a volume 
  2743.         is a network volume (non-zero = network 
  2744.         volume). If you have a network volume that 
  2745.         doesn’t have an AppleTalk address, you need to 
  2746.         use something that isn't zero and isn't a valid 
  2747.         AppleTalk address - I suggest that you use 
  2748.         $ffffffff (-1);  $ffffffff is an illegal AppleTalk 
  2749.         address so it won’t ever be used as a real 
  2750.         AppleTalk address.
  2751. 14    vMVolumeGrade    The relative speed rating of the volume.  The scale 
  2752.         used to determine these values is currently 
  2753.         uncalibrated, so until further notice, return 0 in 
  2754.         this field.
  2755. 18    vMForeignPrivID    The access privilege model supported by the 
  2756.         volume.  Currently two values are defined for this 
  2757.         field: 0 represents a standard HFS volume that 
  2758.         might or might not support the AFP privilege 
  2759.         model; fsUnixPriv represents a volume that 
  2760.         supports the A/UX privilege model.  I recommend 
  2761.         that you use 0 and try to map your privilege model 
  2762.         to the AFP privilege model for maximum 
  2763.         compatibility with Macintosh applications.
  2764. The vMAttrib Field Bits from file systems implementing PBHGetVolParms:
  2765. Bit    Name    Meaning
  2766. 31    bLimitFCBs    The volume supports a small finite number of 
  2767.         open files.  Set this bit to indicate that applications 
  2768.         should attempt to limit the number of files they 
  2769.         keep open on this volume.  For example, the 
  2770.         Finder limits the number of file control blocks 
  2771.         used during copying to 8 instead of 16 if this bit is 
  2772.         set.
  2773. 30    bLocalWList    Set this bit to indicate that the vMLocalHand field 
  2774.         of the GetVolParmsInfoBuffer record is valid and 
  2775.         the Finder’s open window list information is not 
  2776.         stored on this volume.  Shared volumes should set 
  2777.         this bit.
  2778. 29    bNoMiniFndr    Reserved; always set to 1.
  2779. 28    bNoVNEdit    This volume’s name cannot be edited. The 
  2780.         System 7 Finder ignores this bit and looks at 
  2781.         bAccessCntl instead for some reason.
  2782. 27    bNoLclSync    Set this bit to indicate that modification dates on 
  2783.         this volume can change with no action from this 
  2784.         system.  For example, a network volume’s 
  2785.         modification dates can change.
  2786. 26    bTrshOffLine    Set this bit to indicate that this volume does not 
  2787.         support an offline state.  The PBOffLine function 
  2788.         is not supported by this volume.  If the Finder 
  2789.         finds this volume offline, it is zoomed to the Trash 
  2790.         and unmounted.
  2791. 25    bNoSwitchTo    Obsolete.  The Finder will not switch launch to 
  2792.         any application on this volume.
  2793. 24–21        Reserved.  Set to zero.
  2794. 20    bNoDeskItems    Set this bit to indicate that this volume does not 
  2795.         support objects on the desktop.If the volume has a 
  2796.         folder named Desktop Folder in it’s root directory, 
  2797.         it is treated as any other directory.
  2798. 19    bNoBootBlks    Set this bit to indicate that this volume is not a 
  2799.         startup volume. The Startup menu item is 
  2800.         disabled. Boot blocks are not copied during copy 
  2801.         operations.
  2802. 18    bAccessCntl    Set this bit to indicate that this volume supports 
  2803.         AppleTalk AFP access-control interfaces. The 
  2804.         PBHGetLoginInfo, PBHGetDirAccess, 
  2805.         PBHSetDirAccess, PBHMapID, and 
  2806.         PBHMapName functions are supported. Special 
  2807.         folder icons are used. The Access Privileges 
  2808.         (System 6) or Sharing (System 7) menu item is 
  2809.         enabled for disk and folder items.  The ioACUser 
  2810.         field returned by PBGetCatInfo for folders is 
  2811.         assumed to be valid. Note: volumes with 
  2812.         bAccessCntl and vMServerAdr=0 cannot be 
  2813.         unmounted by the Finder and volumes with 
  2814.         bAccessCntl cannot be renamed.
  2815. 17    bNoSysDir    This volume doesn’t support a system directory. 
  2816.         Do not switch launch to this volume.  The system 
  2817.         directory location is not stored in ioVFndrInfo.
  2818. 16    bHasExtFSVol    The bit name isn’t accurate. What this bit says is 
  2819.         that the Disk Initialization Manager is not 
  2820.         supported by this volume’s file system. The 
  2821.         Finder disables Erase Disk item when this bit is 
  2822.         set.
  2823. 15    bHasOpenDeny    This volume supports the PBHOpenDeny and 
  2824.         PBHOpenRFDeny functions.
  2825. 14    bHasCopyFile    This volume supports the PBHCopyFile function, 
  2826.         which is used in copy and duplicate operations if 
  2827.         both source and destination volumes have the 
  2828.         same server address in vMServerAdr.
  2829. 13    bHasMoveRename    This volume supports the PBHMoveRename 
  2830.         function.
  2831. 12    bHasDesktopMgr    This volume supports the Desktop Manager 
  2832.         functions (described in the chapter “Desktop 
  2833.         Manager” in Inside Macintosh: More Macintosh 
  2834.         Toolbox).
  2835. 11    bHasShortName    This volume supports AFP short names with the 
  2836.         GetXCatInfo select code ($3A). Once again, the 
  2837.         bit name isn’t really accurate.
  2838. 10    bHasFolderLock    This volume supports PBHSetFLock and 
  2839.         PBHRstFLock on folders.  A locked folder cannot 
  2840.         be deleted or renamed.
  2841. 9    bHasPersonalAccessPrivileges    This volume has local file sharing enabled.
  2842. 8    bHasUserGroupList    The user and group list of the local file server 
  2843.         returned by the PBGetUGEntry function are valid 
  2844.         for this volume.
  2845. 7    bHasCatSearch    This volume supports the PBCatSearch function.
  2846. 6    bHasFileIDs    This volume supports the file ID reference 
  2847.         functions, including the PBExchangeFiles 
  2848.         function.
  2849. 5    bHasBtreeMgr    Reserved for internal Apple use.
  2850. 4    bHasBlankAccessPrivileges    This volume supports inherited AFP access 
  2851.         privileges for folders.
  2852. 3–0        Reserved.  Set them to zero.
  2853. Q:    Can I write a native Power PC foreign file system with the File System Manager?
  2854. A:    We do not recommend writing File System Manager-based foreign file systems in native Power PC code because there would be a minimum of two mixed mode switches per file system request you handle (you’ll be called from emulated 68K code). Complex file system requests that cause multiple driver requests could cause many more mixed mode switches. If you think of a place where native code would really help the performance of your file system, you’d be best off putting just that code in a Power PC accelerated code resource and calling it from your foreign file system (which would still be mostly in 68K code) only when you need it.
  2855.  
  2856.  
  2857.  
  2858. (dˇ ˇˇˇˇd
  2859. d,Times
  2860. .°dONLNds`ã≠+`Ö Guide to the File System Manager
  2861. 0°dONLNd!a»ëÓ(Ö»
  2862.     °dONLNd"}Óàı)&®
  2863. °dONLNd$ï`°ò(û` Version 1.2°dONLNd0≠`π∫*September 6, 1994ˇdˇ ˇˇˇˇd
  2864. d,Times
  2865.     .°dONLNdcHnO+Hk°dONLNdcUnß)
  2866. Apple Computer, Inc.°dONLNdoHzπ(wH© 1994 Apple Computer, Inc.°dONLNd3{HÜë* All rights reserved.°dONLNdÀc7nÕ(k7LIMITED WARRANTY ON MEDIA AND°dONLNdÈo7zu* REPLACEMENT°dONLNdıá7íÛ*&ALL IMPLIED WARRANTIES ON THIS MANUAL,°dONLNdì7û“* INCLUDING IMPLIED WARRANTIES OF°dONLNd<ü7™‹* !MERCHANTABILITY AND FITNESS FOR A°dONLNd^´7∂€* "PARTICULAR PURPOSE, ARE LIMITED IN°dONLNdÅ∑7¬* *DURATION TO NINETY (90) DAYS FROM THE DATE°dONLNd¨√7Œ* 'OF THE ORIGINAL RETAIL PURCHASE OF THIS°dONLNd‘œ7⁄b* PRODUCT.°dONLNdIìHû(õH5No part of this publication may be reproduced, stored°dONLNdüH™
  2867. * 5in a retrieval system, or transmitted, in any form or°dONLNdµ´H∂⁄* %by any means, mechanical, electronic,°dONLNd€∑H¬* 4photocopying, recording, or otherwise, without prior°dONLNd√HŒ * 2written permission of Apple Computer, Inc. Printed°dONLNdCœH⁄¿*  in the United States of America.°dONLNddÁHÚ*1No licenses, express or implied, are granted with°dONLNdñÛH˛* 2respect to any of the technology described in this°dONLNd…ˇH
  2868.     * 4book. Apple retains all intellectual property rights°dONLNd˛ H˛* 0associated with the technology described in this°dONLNd/H"* 1book. This book is intended to assist application°dONLNda#H.* 1developers to develop applications only for Apple°dONLNdì/H:ù* Macintosh computers.°dONLNd›Á7Úˇ(Ô71Even though Apple has reviewed this manual, APPLE°dONLNdÛ7˛Û* $MAKES NO WARRANTY OR REPRESENTATION,°dONLNd4ˇ7
  2869. ˛* *EITHER EXPRESS OR IMPLIED, WITH RESPECT TO°dONLNd_ 7‚* #THIS MANUAL, ITS QUALITY, ACCURACY,°dONLNdÉ7"Ÿ* !MERCHANTABILITY, OR FITNESS FOR A°dONLNd•#7.Á* %PARTICULAR PURPOSE. AS A RESULT, THIS°dONLNdÀ/7:›* $MANUAL IS SOLD “AS IS,” AND YOU, THE°dONLNd;7F˜* 'PURCHASER, ARE ASSUMING THE ENTIRE RISK°dONLNdG7RŒ* AS TO ITS QUALITY AND ACCURACY.°dONLNd®GHR(OH-Every effort has been made to ensure that the°dONLNd÷SH^ * 4information in this manual is accurate. Apple is not°dONLNd _HjÁ* ,responsible for printing or clerical errors.°dONLNd8_7j)Ô,IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT,°dONLNdek7v–* !INDIRECT, SPECIAL, INCIDENTAL, OR°dONLNdáw7Çı* $CONSEQUENTIAL DAMAGES RESULTING FROM°dONLNd¨É7é˛* (ANY DEFECT OR INACCURACY IN THIS MANUAL,°dONLNd’è7öˆ* 3even if advised of the possibility of such damages.°dONLNd8wHÇö(HApple Computer, Inc.°dONLNdMÉHéÇ* 1 Infinite Loop°dONLNd]èHöö* Cupertino, CA 95014°dONLNdqõH¶Ä* 408-996-1010°dONLNd        ß7≤Í+Ô #THE WARRANTY AND REMEDIES SET FORTH°dONLNd    -≥7æÎ* &ABOVE ARE EXCLUSIVE AND IN LIEU OF ALL°dONLNd    Tø7 ‚* #OTHERS, ORAL OR WRITTEN, EXPRESS OR°dONLNd    xÀ7÷Ú* /IMPLIED. No Apple dealer, agent, or employee is°dONLNd    ®◊7‚˘* 2authorized to make any modification, extension, or°dONLNd    €„7Óó* addition to this warranty.°dONLNd~≥HæÍ(ªH'Apple, the Apple logo, APDA, AppleLink,°dONLNd¶øH Ë* 'AppleShare, AppleTalk, A/UX, EtherTalk,°dONLNdŒÀH÷* /LaserWriter, Macintosh, MPW, PowerBook, ProDOS,°dONLNd˛◊H‚* /and TokenTalk are trademarks of Apple Computer,°dONLNd.„HÓÚ* /Inc., registered in the United States and other°dONLNd^ÔH˙n*
  2870. countries.°dONLNd    ˆ˚7˝+Ô 4Some states do not allow the exclusion or limitation°dONLNd
  2871. +7Ú* 4of implied warranties or liability for incidental or°dONLNd
  2872. `7ı* 1consequential damages, so the above limitation or°dONLNd
  2873. í7*ˇ* 3exclusion may not apply to you. This warranty gives°dONLNd
  2874. Δ+76Ì* 0you specific legal rights, and you may also have°dONLNd
  2875. ˜77BŸ* ,other rights which vary from state to state.°dONLNdiH˝(H,Apple Desktop Bus, Apple SuperDrive, Balloon°dONLNdñH* 2Help, Finder, ResEdit, Macintosh Quadra, PowerBook°dONLNd…H** 2Duo, Power Macintosh, System 7, and QuickDraw, are°dONLNd¸+H6œ* "trademarks of Apple Computer, Inc.°dONLNdCHN˘*.Motorola is a registered trademark of Motorola°dONLNdNOHZz* Corporation.°dONLNd[gHr*0UNIX is a trademark of UNIX System Laboratories,°dONLNdåsH~W* Inc.°dONLNdëãHñ*1Simultaneously published in the United States and°dONLNd√óH¢f* Canada.ˇ‰dˇ ˇˇˇˇd
  2876. d,     Helvetica
  2877. .°dONLNdV`hk+`d1°dONLNdVÑhñ)$THE FILE SYSTEM MANAGER Q^Q h^h,Times
  2878. (Ú
  2879. 1-)
  2880. 1ˇdˇ ˇˇˇˇd
  2881. d,Times
  2882. .+H3 Guide to the File System Manager,     Helvetica
  2883. °dONLNdUHdÚ*-ABOUT THIS CHAPTER NFN gFg
  2884. °dONLNd~Hä‰*'VThis chapter describes foreign file systems and the File System Manager (FSM). It also°dONLNdjäHñÒ* Zprovides a complete description of all FSM data types, FSM service routines available to a°dONLNd≈ñH¢Æ* Iforeign file system and other programs, and the FSM component interfaces.
  2885. °dONLNd«H÷;*3ABOUT FOREIGN FILE SYSTEMS ¿F¿ ŸFŸ
  2886. °dONLNd*H¸*'[A foreign file system allows Macintosh applications to gain access to non-Macintosh volumes°dONLNdܸHÎ* Vusing File Manager routines. For example, a Macintosh application can use File Manager°dONLNd›H˘* _routines to read from and write to files on a ProDOS disk if there is a foreign file system for°dONLNd=H t* ProDOS.°dONLNdE,H8˘*[In the past, developing a foreign file system required extensive knowledge of the Macintosh°dONLNd°8HD‰* OFile Manager and how it used both documented and undocumented low-memory global°dONLNdÒDHP·* Wvariables and data structures. To solve this problem, Apple has written the File System°dONLNdIPH\Õ* QManager. To create a new foreign file system, developers no longer need to access°dONLNdõ\Hh€* Sundocumented portions of the Macintosh and interface with the Macintosh file system°dONLNdÔhHtÌ* [through a 68000 register-based interface. Instead, they provide a foreign file system for a°dONLNdKtHÄÔ* Wparticular file system that works with the File System Manager. The File System Manager°dONLNd£ÄHåˇ* ]provides a systematic way for one or more foreign file systems to interact with the Macintosh°dONLNdåHò&* 0file system using high-level language interface.°dONLNd2§H∞Ì*WThe File System Manager performs low-level tasks common to all foreign file systems. It°dONLNdä∞HºÍ* ]intercepts incoming file system related traps, identifies the foreign file system the request°dONLNd˺H»ˇ* ^should be passed to, and then passes on only those requests requiring action by the particular°dONLNdG»H‘ˇ* _foreign file system. To develop a foreign file system, you provide a set of foreign file system°dONLNdß‘H‡fi* Sroutines—described in the following chapters—that the File System Manager can call.°dONLNd˚ÏT¯≤+ Important Note: °dONLNd Ï≤¯ÿ)^:Even though the File System Manager provides many services°dONLNdF¯T‰(TVthat simplify development of foreign file systems, developing a foreign file system is°dONLNdùT–* Oboth a difficult and time-consuming process. A minimal foreign file system must°dONLNdÌT‰* Timplement over forty Macintosh file system routines while a networked, sharable file°dONLNdBT(·* Rsystem will have to implement as many as eighty Macintosh file system routines. To°dONLNdï(T4—* Rwrite a foreign file system you must be familiar with the low-level Macintosh file°dONLNdË4T@N* 6system data routines and data structures described in °dONLNd    4N@º)˙Inside Macintosh: Files°dONLNd    54º@Ë)n     and with°dONLNd    ?@TL(IT,the material covered in the chapters of the °dONLNd    k@Lª)Δ Guide to the File System Manager°dONLNd    ã@ªLø)°.
  2887. °dONLNd    çwHÜZ(ÇHABOUT THE FILE SYSTEM MANAGER pFp âFâ
  2888. °dONLNd    ´†H¨ˇ*'ZThe File System Manager is the part of the Macintosh Operating System that manages the use°dONLNd
  2889. ¨H∏* Zof foreign file systems. The File System Manager provides a general means by which foreign°dONLNd
  2890. a∏Hƒ¬* Sfile systems can be installed, identified, and interfaced to the Operating System .*11-)
  2891. 2)&About the File System Managerˇdˇ ˇˇˇˇd
  2892. d,Times
  2893. .(3¢The File System Manager°dONLNdU`a(^`PThe Operating System services provided by the File System Manager are called FSM°dONLNdQa`m* Zcomponents and the interface mechanism between an foreign file system and a particular FSM°dONLNd¨m`y˝* Pcomponent is known as a FSM component interface. At this time, two FSM component°dONLNd˝y`Öy* ;interface are defined for use under the File System Manager°dONLNd9ëlùp+ •°dONLNd;ëyùÙ)
  2894. Nthe HFS Component Interface which allows a foreign file system to process File°dONLNdäùy©Ã* Manager requests°dONLNdõµl¡p(æl•°dONLNdùµy¡)
  2895. Uthe Disk Initialization Package Component Interface which allows foreign file systems°dONLNdÛ¡yÕ}* 8to initialize foreign file system volumes on a Macintosh°dONLNd,Ÿ`Â(‚`ZFor each installed file system, the File System Manager maintains a file system descriptor°dONLNdáÂ`Ò* \(FSD). Information in the FSD identifies the file system and describes its interfaces to the°dONLNd‰Ò`˝˝* SFile System Manager and to the FSM component interfaces supplied by the File System°dONLNd8˝`    Í* PManager. Installed FSDs are kept in the File System Manager’s private FSD queue.°dONLNdâ`!*XA foreign file system’s FSD can be installed, accessed, maintained, and removed with the°dONLNd‚!`-* ZFSM service routines. FSM service routines also allow applications to communicate with the°dONLNd=-`9Û* UFile System Manager and foreign file systems, and allow disk drivers and foreign file°dONLNdì9`Ec* 3systems to communicate with the File System Manager°dONLNd«Q`]*VFigure 1-1 shows how the Operating System and the File System Manager work together to°dONLNd]`iF* 2allow applications to access foreign file systems.(ÚWAbout the File System Manager)¥1-)
  2896. 3ˇ–dˇ ˇˇˇˇd
  2897. d,Times
  2898. .+H3 Guide to the File System Manager†Ç†å
  2899. UN˘˚0èÕêŒ888°ñ °ö 
  2900. ∏Z‚ò,     Helvetica.§≠§≠°dONLNdˇˇ+è
  2901. Macintosh
  2902. ,İdONLNdˇˇ*
  2903. Operating
  2904. ⁄@°dONLNdˇˇ*System†ó°ñ °ö
  2905. cô
  2906. ⁄¿°dONLNdˇˇ+    + File System ⁄ °dONLNdˇˇ* Manager†ó°ñ °öˇ˝+
  2907. ®2¥åMİdONLNdˇˇ+œúForeign File System†ó°ñ °ö
  2908. ∏:–s1 °dONLNdˇˇ(¡OFile İdONLNdˇˇ(ÕCManager†ó°ñ °ö%
  2909. ∏ì–fl܇°dONLNdˇˇ(¡îDisk Initialization
  2910. ¯`°dONLNdˇˇ+ Package†ó
  2911. UN˘˚    ™U™U™U™U0±(◊Ñ0±ã◊Á0Y(0ûO;˙°d
  2912. MDPL    †å    ˇˇˇˇˇˇˇˇq'à5ê'å5ê5å5à'åqéàúêúåéàéåéêúå"5åY†ç°dMDPL
  2913.     ™U™U™U™U0VOê˙    1c|Éúê¬ ‚4¬‚.c|Éú@† Ä@@Ä ¡  Ä @LÄrü„¿å¿Ä@¿@ ¿ ¿˘¿á¿¿àP °ñ °öˇ˝
  2914. lZzú
  2915. °dONLNdˇˇ(v[ Applications†ó°d
  2916. MDPL    †å
  2917. UN˘˚    ˇˇˇˇˇˇˇˇq÷R‰Z÷V‰Z‰V‰R÷VqÏR˙Z˙VÏRÏVÏZ˙V"‰V†ç°dMDPL
  2918. °d
  2919. MDPL    †åq¯,¸,,¸,¯¸",¸y†ç°dMDPL
  2920. °d
  2921. MDPL    †åq÷µ‰Ω÷π‰Ω‰π‰µ÷πqϵ˙Ω˙πϵÏπÏΩ˙π"‰π†ç°dMDPL
  2922. °d
  2923. MDPL    †åqÏπ˙¡˙ΩÏπÏΩÏ¡˙Ωqéπú¡éΩú¡úΩúπéΩ"ÏΩ∞†ç°dMDPL
  2924. °d
  2925. MDPL    †åqéRúZéVúZúVúRéVq§R≤Z≤V§R§V§Z≤V"úV†ç°dMDPL
  2926. °d
  2927. MDPL    †åqéµúΩéπúΩúπúµéπq§µ≤Ω≤π§µ§π§Ω≤π"úπ†ç°dMDPL
  2928.     1cÉ0ê¬ ‚4¬‚.cÉ0@† Ä@@Ä ¡  Ä @LÄrü„¿å¿Ä@¿@ ¿ ¿˘¿á¿¿àP 1c§Éƒê¬ ‚4¬‚.c§Éƒ@† Ä@@Ä ¡  Ä @LÄrü„¿å¿Ä@¿@ ¿ ¿˘¿á¿¿àP     ™U™U™U™U0ö¬†°dMDPL    1WYmâ°ñ °ö
  2929. WYmâ
  2930.     °dONLNdˇˇ+ˇÈ File System ˇp°dONLNdˇˇ*
  2931. Descriptor†ó°dMDPL
  2932. UN˘˚    ™U™U™U™U"Kå-°ñ °ö    
  2933. )ɰdONLNdˇˇ(    MHFS
  2934. p°dONLNdˇˇ(,Component Interface†ó°ñ °ö 
  2935. åÊч°dONLNdˇˇ(    òDisk Initialization
  2936. ц°dONLNdˇˇ(èComponent Interface†ó°ñ °ö)
  2937. ºä°dONLNdˇˇ(    ¿File System Manager
  2938. ä°dONLNdˇˇ+
  2939. Service Calls†ó
  2940. UN˘˚0˙¥!0˙)Ñ0˙åÁ @IKzó°ñ °öˇ˝
  2941. æ◊ 
  2942. 
  2943. 0°dONLNdˇˇ(«Ÿ Disk Drivers†ó
  2944. UN˘˚0±≈◊!°d
  2945. MDPL    †å    ˇˇˇˇˇˇˇˇq÷Ô‰˜÷Û‰˜‰Û‰Ô÷ÛqÏÔ˙˜˙ÛÏÔÏÛϘ˙Û"‰Û†ç°dMDPL
  2946.     ™U™U™U™U@I•zÒ°d
  2947. MDPL    †å    ˇˇˇˇˇˇˇˇq'‚5Í'Ê5Í5Ê5‚'Êqƒ‚“͓ʃ‚ƒÊƒÍ“Ê 5ʃʆç°dMDPL
  2948.     ™U™U™U™U"KÊ-°ñ °öˇ˝+
  2949. fiåÍʰdONLNdˇˇ(ÁçForeign File System†ó
  2950. UN˘˚0–x¯˙    ˇˇˇˇˇˇˇˇ`ú¸Ø¥Z°d
  2951. MDPL    †åq™≤ Æ ≤ƙƠ"Æ
  2952. †ç°dMDPL
  2953. °d
  2954. MDPL    †åq‘,‹ÿ,‹,ÿ,‘ÿ ,ÿ€ÿ†ç°dMDPL
  2955. `“ÿÂÎ¥Z°d
  2956. MDPL    †åq‡lËz‰zËl‰l‡l‰z ‰·‰l†ç°dMDPL
  2957. °dMDPL    1W≥m„°ñ °ö
  2958. W≥m„
  2959.     °dONLNdˇˇ(_¥ File System ˇp°dONLNdˇˇ*
  2960. Descriptor†ó°dMDPL†ç†É
  2961. d
  2962. .°dONLNdRì(R Figure 1-1.°dONLNd ì˜)AI  Applications using foreign file systems through the File System Manager(ÚH1-)
  2963. 4)&About the File System Managerˇ,dˇ ˇˇˇˇd
  2964. d,Times
  2965. .(3¢The File System Manager,     Helvetica
  2966. °dONLNds`Çn(~`USING THE FILE SYSTEM MANAGER l^l Ö^Ö
  2967. °dONLNdú`®»*'This section describes°dONLNd5¥l¿p+ •°dONLNd7¥y¿ )
  2968. File system descriptors (FSDs)°dONLNdVÃlÿp(’l•°dONLNdXÃyÿ¯)
  2969. FSM component interfaces°dONLNdq‰lp(Ìl•°dONLNds‰yÑ)
  2970. 8how to determine if the File System Manager is available°dONLNd¨¸lp(l•°dONLNdƸyd)
  2971. 2how foreign file systems are installed and enabled
  2972. °dONLNd· `/ (+`File System Descriptors /^/
  2973. °dONLNd˘<`H*[The File System Manager maintains a file system descriptor (FSD) for each installed foreign°dONLNdUH`T
  2974. * ^file system. Information in the FSD identifies the file system and describes its interfaces to°dONLNd¥T``¶* Athe FSM component interfaces supplied by the File System Manager.°dONLNdˆl`x *XA foreign file system’s FSD is installed, accessed, maintained, and removed with the FSM°dONLNdOx`Ñ* Zservice routines. FSDs are created with InstallFS. A copy of the information in an FSD can°dONLNd™Ñ`ê* Tbe obtained with GetFSInfo. Information in an FSD can be modified with SetFSInfo. An°dONLNdˇê`ú* TFSD can be removed with RemoveFS. The FSM service routines use the data type FSDRec.,
  2975. Courier
  2976. °dONLNdT±lΩΔ+ !struct FSDRec {°dONLNddΩä…ÿ+
  2977. struct FSDRec°dONLNdrΩÁ…)]    *fsdLink;°dONLNd|Ωn…‘)á/* ptr to next */°dONLNdé…ä’®(“äshort°dONLNdî…Á’#)]
  2978. fsdLength;°dONLNdü…n’˛)á/* length of this FSD in°dONLNdΩ’Ä·∞+ bytes */°dONLNdΔ·äÌ®(Íäshort°dONLNd÷ÁÌ))] fsdVersion;°dONLNdÿ·nÌÊ)á/* version number */°dONLNdÌÌ䢮(ˆäshort°dONLNdÛÌÁ˘A)]fileSystemFSID;°dONLNdÌn˘Ê)á/* file system id */°dONLNd˘ä®(äStr31°dONLNd˘ÁA)]fileSystemName;°dONLNd.˘nÚ)á/* file system name */°dONLNdEäÆ(äFSSpec°dONLNdLÁA)]fileSystemSpec;°dONLNd\n˛)á/* foreign file system's°dONLNdzÄ∂+     FSSpec */°dONLNdÑä)ú(&äPtr°dONLNdàÁ)e)]fileSystemGlobalsPtr;°dONLNdûn)Ï)á/* ptr to file system°dONLNdπ)Ä5º+
  2979. globals */°dONLNdƒ5äAΔ(>ä
  2980. FSDCommUPP°dONLNdœ5ÁAY)]fileSystemCommProc;°dONLNd„5nA
  2981. )á/* communication proc with°dONLNdAÄMº+
  2982. the FFS */°dONLNdMäY¢(Välong°dONLNdMÁY#)]
  2983. reserved3;°dONLNdMnY)á/* reserved, must be 0 */°dONLNd8Yäe¢(bälong°dONLNd=YÁe#)]
  2984. reserved2;°dONLNdHYne)á/* reserved, must be 0 */°dONLNdbeäq¢(nälong°dONLNdgeÁq#)]
  2985. reserved1;°dONLNdrenq)á/* reserved, must be 0 */°dONLNdåqä}∫(zäHFSCIRec°dONLNdïqÁ})]    fsdHFSCI;°dONLNdüqn}Œ)á/* HFS component°dONLNdµ}Äâ»+ interface */°dONLNd¬âäï¥(íäDICIRec°dONLNd âÁï)]fsdDICI;°dONLNd”ânïÚ)á/* Disk Initialization°dONLNdÔïİ+ component interface */°dONLNd°ä≠ñ(™ä};°dONLNd    ≠äπ8* typedef struct FSDRec FSDRec;°dONLNd'πä≈&* typedef FSDRec *FSDRecPtr;
  2986. +Õ0Using the File System Manager)¥1-)
  2987. 5ˇÃdˇ ˇˇˇˇd
  2988. d,Times
  2989. .+H3 Guide to the File System Manager°dONLNdUHaÆ*+Field descriptions°dONLNdoH{m*fsdLink°dONLNdo∏{~)p,A pointer to the next entry in the FSD list.°dONLNdHÉHèx(åH    fsdLength°dONLNdRÉ∏è])p#The length of of this FSD in bytes.°dONLNdvóH£|(†H
  2990. fsdVersion°dONLNdÅó∏£‚)p?The lowest version of the File System Manager this foreign file°dONLNd¡£∏Øw* )system can support. Currently, this is 1.°dONLNdÎ∑H√î(¿HfileSystemFSID°dONLNd˙∑∏√)pFThe unique file system ID (FSID) of the foreign file system. See “File°dONLNdA√∏œ˘* >System ID Numbers” on page 1-7 for more information about FSID°dONLNdÄœ∏€Â* numbers.°dONLNdâ„HÔñ(ÏHfileSystemName°dONLNdò„∏Ô„)pBA Pascal string (Str31) which is used to identify the foreign file°dONLNd€Ô∏˚ˇ* Dsystem. It is not guaranteed to be unique. fileSystemName is used by°dONLNd ˚∏ˇ* Fthe Disk Initialization Package. The name is displayed in a dialog box°dONLNdg∏Ó* Cthat presents the user a choice of file system formats with which a°dONLNd´∏%* disk may be initialized.°dONLNdƒ'H3ë(0HfileSystemSpec°dONLNd”'∏3Ï)pCAn FSSpec indicating the location of the foreign file system’s file°dONLNd3∏?ˆ* Ccode file. The File System Manager fills in fileSystemSpec with the°dONLNd[?∏KÔ* Blocation of the current resource file (CurResFile) when the FSD is°dONLNdûK∏W * installed by InstallFS.°dONLNd∂_Hk≠(hHfileSystemGlobalsPtr°dONLNdÀ_∏kÛ)pGA pointer to the foreign file system’s optional global data area. It is°dONLNdk∏w–* <passed to the foreign file system as a parameter for all FSM°dONLNdPw∏ÉÛ* Dcomponent interface requests to the foreign file system. A nil value°dONLNdïÉ∏èÿ* ?indicates no global area was allocated. The global data area is°dONLNd’è∏õØ* 7allocated by the foreign file system installation code.°dONLNd
  2991. £HØ∞(¨HfileSystemCommProc°dONLNd £∏Ø„)p?A pointer to the foreign file system’s communications function.°dONLNd`∑H√v(¿H    reserved3°dONLNdj∑∏√,)pReserved. Must be zero.°dONLNdÇÀH◊v(‘H    reserved2°dONLNdåÀ∏◊,)pReserved. Must be zero.°dONLNd§flHÎv(ËH    reserved1°dONLNdÆfl∏Î,)pReserved. Must be zero.°dONLNdΔÛHˇz(¸HfsdHFSCI°dONLNdœÛ∏ˇ˝)pBThe foreign file system’s HFS component interface record. See “The°dONLNdˇ∏ * AHFS Component Interface Record” in Chapter 2 for more information°dONLNdT ∏Ñ* )about the HFS component interface record.°dONLNd~H+o((HfsdDICI°dONLNdÜ∏+Ê)pAThe foreign file system’s Disk Initialization component interface°dONLNd»+∏7˙* Crecord. See “The Disk Initialization Component Interface Record” in°dONLNd 7∏C–* <Chapter 4 for more information about the Disk Initialization°dONLNdIC∏O<* component interface record.,     Helvetica
  2992. °dONLNdegHvı(rHFile System ID Numbers
  2993. °dONLNd|ÅHç˚*^A file system ID (FSID) number is a unique word-length value that identifies a particular file°dONLNd€çHô* Zsystem. This number is used by the Macintosh file system and by the File System Manager to°dONLNd6ôH•Ò* \identify a particular file system. The FSID value passed to InstallFS is checked by the File°dONLNdì•H±Ó* XSystem Manager to insure that a FSD with that FSID is not already installed. The FSID is°dONLNdϱHΩÛ* ^passed as a parameter to all File System Manager service routines. Table 1-1 is a list of file°dONLNd    KΩH…:* 1system IDs currently owned by Apple file systems.*,1-)
  2994. 6)&Using the File System Managerˇ2dˇ ˇˇˇˇd
  2995. d,Times
  2996. .(3¢The File System Manager°dONLNdU`a(^`Table
  2997.     °dONLNdVaÅ) 
  2998. °dONLNdUÅaô)1-1.°dONLNd U®aÄ)'+File System IDs owned by Apple file systems°dONLNd7l`x~(u`FSID°dONLNd<lñxŸ)6 File System e^e°dONLNdHÑ`ê~(ç`$0000°dONLNdNÑñê    )6Macintosh HFS or MFS°dONLNddú`®~(•`$0100°dONLNdjúñ®˘)6ProDOS File System°dONLNd~¥`¿~(Ω`$0101°dONLNdÑ¥ñ¿)6PowerTalk Mail Enclosures°dONLNdüÃ`ÿ~(’`$4147°dONLNd•Ãñÿé)62ISO 9660 File Access (through Foreign File Access)°dONLNdŸ‰`~(Ì`$4242°dONLNdfl‰ñó)65High Sierra File Access (through Foreign File Access)°dONLNd¸`Ä(`$464D°dONLNd¸ñï)63QuickTake File System (through Foreign File Access)°dONLNdQ` ~(`$4953°dONLNdWñ A)6Macintosh PC Exchange (MS-DOS)°dONLNdw,`8Ä(5`$4A48°dONLNd},ñ8{)6-Audio CD Access (through Foreign File Access)°dONLNd¨D`PÇ(M`$4D4B°dONLNd≤DñPÜ)60Apple Photo Access (through Foreign File Access)°dONLNdÂh`t
  2999. (q`XFSID values between $0001 and $00FF are reserved for old-style foreign file systems that°dONLNd>t`Ä* Zdetermine their FSID’s dynamically (i.e., by searching the drive queue) and cannot be used°dONLNdôÄ`å9* -for File System Manager foreign file systems.°dONLNd«ò`§*VFSID values between $0100 and $7FFF are reserved for the File System Manager and other°dONLNd§`∞ä* @foreign file systems that use registered file system ID numbers.°dONLNd_º`»Ë*OFSID values $8000 and above are reserved for future use by Apple Computer, Inc.°dONLNdØ‘`‡*RFSID values fsmIgnoreFSID ($FFFE) and fsmGenericFSID ($FFFF) have special meaning.°dONLNd‡`Ï* ^fsmIgnoreFSID is stored in the partition map on a partitioned disk. It signals the disk driver°dONLNdaÏ`¯* _not to install this partition into the drive queue. fsmGenericFSID is stored in the drive queue°dONLNd¡¯` * Xelement (DrvQEl) by the disk driver to signal an unknown foreign file system volume. The°dONLNd`* _File System Manager will attempt to find a foreign file system that can identify disks with the°dONLNdz`Û* PfsmGenericFSID by calling each foreign file system with the ffsIDVolMountMessage°dONLNdÀ`(* Vmessage. This allows disk drivers to support multiple volume formats without having to°dONLNd"(`4·* identify the volume format.°dONLNd>@`L¸*STo reserve a FSID in the File System Manager range ($0100 through $7FFF), a special°dONLNdíL`XÍ* Qcreator type must be registered with Apple’s Developer Support Center (AppleLink:°dONLNd‰X`d* QDEVSUPPORT). The high word of the creator type must be $0613. The low word of the°dONLNd6d`p* _creator type is the FSID to register. For example, to reserve the FSID $0100 for a foreign file°dONLNdñp`|* [system, the creator type $06130100 should be registered. The creator type registered for an°dONLNdÚ|`à˚* XFSID can also be used as the creator type of the system extension file that implements a°dONLNdKà`îº* foreign file system.°dONLNd`†l¨ß+ 
  3000. Important:°dONLNdj†ß¨Í);A File System ID numbers in the File System Manager range were not°dONLNd¨¨l∏¸(µlXregistered before 1993. As a result, there are foreign file systems in use that have not°dONLNd    ∏lƒ˚* Tregistered with Apple’s Developer Support Center. If you are the publisher of one of+Î1Using the File System Manager)¥1-)
  3001. 7ˇ
  3002. Ódˇ ˇˇˇˇd
  3003. d,Times
  3004. .+H3 Guide to the File System Manager°dONLNdUTa‰+ +Vthose foreign file systems, please register your FSID immediately to help prevent file°dONLNdWaTm≥* system ID conflicts.,     Helvetica
  3005. °dONLNdlÖHî[(êH#File System Communications Function
  3006. °dONLNdêüH´¯*TThe communications function pointed to by fileSystemCommProc in an FSDRec is used by°dONLNd´H∑Ô* Wthe File System Manager to communicate with a foreign file system. When the file system°dONLNd=∑H√˛* ^communications function is called, it is passed a message and a pointer to a buffer containing°dONLNdú√Hœ* [any additional parameters needed to process the message. The currently defined messages are°dONLNd¯œH€°* listed in Table 1-2.°dONLNd
  3007. ÁHÛg*Table
  3008.     °dONLNdËgÛi) 
  3009. °dONLNdÁiÛÅ)1-2.°dONLNdÁêÛy)',File System Communications Function Messages°dONLNdE˛H
  3010. x(HMessage°dONLNdM˛ÿ
  3011. )êPurpose ˜F˜°dONLNdUH"ì(H
  3012. ffsNopMessage°dONLNdcΔ"Ã)~0°dONLNdeÿ")<No operation. The file system communications function should°dONLNd¢"ÿ.k*  simply return a result of noErr.°dONLNdƒ:HF§(CHffsGetIconMessage°dONLNd÷:ΔFÃ)~1°dONLNdÿ:ÿFZ)Return disk icon and mask.°dONLNdÙRH^†([HffsIDDiskMessage°dONLNdRΔ^Ã)~2°dONLNdRÿ^õ)(Identify the volume about to be mounted.°dONLNd1jHvñ(sHffsLoadMessage°dONLNd@jΔvÃ)~3°dONLNdBjÿv˙);Load the foreign file system’s HFS component interface code°dONLNd~vÿÇ*     and data.°dONLNdâéHö°(óHffsUnloadMessage°dONLNdöéΔöÃ)~4°dONLNdúéÿöÏ)8Unload the foreign file system’s HFS component interface°dONLNd’öÿ¶* code and data.°dONLNdÂ≤Hæ∫(ªHffsIDVolMountMessage°dONLNd˙≤ΔæÃ)~5°dONLNd¸≤ÿæ≈)2Identify a VolMountInfo record by its media field.°dONLNd0 H÷ü(”HffsInformMessage°dONLNdA Δ÷Ã)~6°dONLNdC ÿ÷à)$Foreign file system defined message.°dONLNdi‚HÓ–(ÎHV The file system communications function is described in detail later in this chapter.
  3013. °dONLNd¿H√* Global Data Area
  3014. °dONLNd—H&Û*YUnlike a Macintosh application, a foreign file system possesses no A5 world. Therefore, a°dONLNd+&H2˚* \foreign file system cannot define and use global variables. Instead, the File System Manager°dONLNdà2H>Ù* ^allows a foreign file system to allocate a global data area which is used to store data needed°dONLNdÁ>HJÌ* $globally by the foreign file system.°dONLNd VHbÏ*[The global data area must be allocated in the system heap before the foreign file system is°dONLNdhbHnÓ* ]installed and the address of the global data area is stored in the foreign file system’s FSD.°dONLNdΔnHzÚ* [Every time the File System Manager calls a foreign file system function, the address of the°dONLNd"zHÜÚ* ]global data area is passed to the foreign file system as one of the function parameters. This°dONLNdÄÜHíæ* Tallows any part of a foreign file system to access the data in its global data area.*c1-)
  3015. 8)&Using the File System ManagerˇÜdˇ ˇˇˇˇd
  3016. d,Times
  3017. .(3¢The File System Manager,     Helvetica
  3018. °dONLNdU`d%(``FSM Component Interfaces d^d
  3019. °dONLNdq`}*QThe File System Manager supplies an interface mechanism known as an FSM component°dONLNdk}`â * Yinterface. An FSM component interface can be any functional interface exported by a given°dONLNd≈â`ï* SMacintosh operating system or toolbox component. Each FSM component interface is an°dONLNdï`°    * Xindependent interface, defined and managed by a particular Macintosh operating system or°dONLNdr°`≠* _toolbox component. This includes the definition of the calls involved, the dispatching of calls°dONLNd“≠`π˙* Xto the foreign file systems, and the execution environment in which those calls operate.°dONLNd+≈`—ˆ*TAt this time, two FSM component interfaces are defined for use under the File System°dONLNdÄ—`›â* Manager°dONLNdàÈlıp+ •°dONLNdäÈyıÙ)
  3020. Nthe HFS Component Interface which allows a foreign file system to process File°dONLNdŸıyÃ* Manager requests°dONLNdÍ
  3021. lp(l•°dONLNdÏ
  3022. y)
  3023. Uthe Disk Initialization Package Component Interface which allows foreign file systems°dONLNdBy%}* 8to initialize foreign file system volumes on a Macintosh°dONLNd{1`=(:`SThe FSD and the FSM component interface mechanism are both designed so that new FSM°dONLNdœ=`I* Ycomponent interfaces can be added by Apple Computer to the File System Manager at a later°dONLNd)I`U¶* time if needed.°dONLNd9a`m*VThe connection between a given component and a foreign file system is defined by a FSM°dONLNdêm`y * Wcomponent interface record which is contained in a foreign file system’s FSD. A minimum°dONLNdËy`Ö˛* UFSM component interface record includes a dispatch mask which controls the use of the°dONLNd>Ö`ë * ^interface, and at least one pointer to the foreign file system code responsible for processing°dONLNdùë`ù* Ythe requests from that component. Additional interface parameters other than the dispatch°dONLNd˜ù`©* Wmask and code pointer may be included in a given FSM component interface. These are FSM°dONLNdO©`µ* Ycomponent interface dependent parameters and are not required by the File System Manager.°dONLNd©µ`¡* [These parameters are later used by the individual operating system or toolbox components to°dONLNd¡`ÕE* 3dispatch their requests to the foreign file system.
  3024. °dONLNd9fl`Óä* %FSM Component Interface Dispatch Mask
  3025. °dONLNd_˘`*WThe first long word of an FSM component interface record is the FSM component interface°dONLNd∑`˘* Sdispatch mask (compInterfMask). The bits of the compInterfMask currently have these°dONLNd `ê*     meanings:°dONLNd5lA}+ $Bit°dONLNd5ñA∂)*Name°dONLNd54Ad)ûMeaning°dONLNd&MlYÇ(Vl0-23°dONLNd,M4Y)»-FSM component interface dependent flags. Each°dONLNd]Y4e¯* +component is free to define these flag bits°dONLNdåe4qf*
  3026. as needed.°dONLNdóql}à(zl24-29°dONLNdûq4}    )»+Reserved for the File System Manager’s use.°dONLNd }lâx(Ül30°dONLNdÕ}ñâ)*fsmComponentBusyBit°dONLNd·}4â)û2If set, the FSM component interface is busy (i.e.,°dONLNd    â4ï* 2one or more requests are outstanding). This bit is°dONLNd    Mï4° * 0maintained by the component and used by the File°dONLNd    Å°4≠ı* (System Manager to control the use of the°dONLNd    ≠≠4π* .SetFSInfo File System Manager service routine.+#<Using the File System Manager)¥1-)
  3027. 9ˇ
  3028. tdˇ ˇˇˇˇd
  3029. d,Times
  3030. .+H3 Guide to the File System Manager°dONLNdUTa`+ +31°dONLNdU~aı)*fsmComponentEnableBit°dONLNdUaÌ)û+If set, the component may begin dispatching°dONLNdHam * 5requests to the foreign file system. The foreign file°dONLNdÅmy* -system should set this bit with the SetFSInfo°dONLNd≤yÖı* .File System Manager service routine once it is°dONLNd‰Öëî* ready to receive requests.,     Helvetica
  3031. °dONLNdˇ£H≤ú(ÆH+FSM Component Interface Processing Function
  3032. °dONLNd+ΩH…˜*WThe second long word of an FSM component interface record is a pointer (compInterfProc)°dONLNdÉ…H’Á* Yto the foreign file system code responsible for processing redirected operating system or°dONLNd›’H·Ì* Ztoolbox requests. Which operating system or toolbox requests are redirected is part of the°dONLNd8·Ḧ* #FSM component interface definition.
  3033. °dONLNd\ˇHº* /FSM Component Interface Dispatching Conventions
  3034. °dONLNdåH%Á*VIn order to insure some degree of uniformity across FSM component interfaces, the File°dONLNd„%H1—* ISystem Manager imposes some common conventions for use by components when°dONLNd-1H=à* Ddispatching requests to a foreign file system. Those conventions are°dONLNdrITUX+ •°dONLNdtIaU¸)
  3035. VThe global pointer (fileSystemGlobalsPtr) from the FSD record is passed to the foreign°dONLNdÀUaa* Wfile system on all requests. The global pointer is needed to locate context information°dONLNd#aamf* 9associated with the operation of the foreign file system.°dONLNd]yTÖX(ÇT•°dONLNd_yaÖ¯)
  3036. UThe FSM component interface should dispatch requests to a foreign file system only if°dONLNdµÖaë˝* Sthe fsmComponentEnableBit flag in the FSM component interface dispatch mask is set.°dONLNd    ùT©X(¶T•°dONLNd ùa©˙)
  3037. TThe FSM component interface will set the fsmComponentBusyBit flag in the target file°dONLNd`©aµ˚* Ssystem’s FSM component interface dispatch mask when the interface is dispatched and°dONLNd¥µa¡ı* Uclear the flag when the request has completed. This will prohibit modification of FSM°dONLNd
  3038. ¡aÕ=* ,component interface parameters by SetFSInfo.
  3039. °dONLNd7ÂHÙO(H#Ensuring the File System Manager is°dONLNd[ÛHä*    Available Få
  3040. °dONLNdeH˘*ZYou must ensure the File System Manager is available on the user’s computer before calling°dONLNd¿H'* [the File System Manager. You can determine is the File System Manager is available by using°dONLNd'H3fl* Wthe Gestalt function. The Gestalt selector is gestaltFSAttr. The File System Manager is°dONLNdt3H?s* Cavailable if the Gestalt function returns a result of noErr and the°dONLNd∏?HKÄ* AgestaltHasFileSystemManager bit is set in the response parameter.°dONLNd˙WHc˚*\In addition, you must ensure the File System Manager is version 1.2. Earlier versions of the°dONLNdWcHo÷* TFile System Manager do not implement all of the interfaces described in this manual.*Ü1-)
  3041. 10)&Using the File System Managerˇ ¶dˇ ˇˇˇˇd
  3042. d,Times
  3043. .(3¢The File System Manager°dONLNda`mÚ(j`VListing 1-1 illustrates how you use Gestalt to determine if the File System Manager is°dONLNdWm`y∑* Javailable and ensure that the File System Manager is version 1.2 or later.°dONLNd¢ÖàëÃ+( Listing 1-1.°dONLNdÆÖÃëÚ)D=  Testing for the required version of the File System Manager,
  3044. Courier
  3045. °dONLNdÏö`¶Ñ(£`static°dONLNdÛöñ¶¿)6Boolean°dONLNd˚ööD)6HasRequiredFSM(void)°dONLNd¶`≤f(Ø`{°dONLNd≤ræä+ long°dONLNd≤ñæÃ)$    response;°dONLNd#ær ú(«rBoolean°dONLNd+æ® “)6result;°dONLNd6÷r‚Ã(flrresult = false;°dONLNdG‚rÓ™* 4/* Make sure the File System Manager is installed */°dONLNd}Ór˙ò* 1if ( Gestalt(gestaltFSAttr, &response) == noErr )°dONLNd∞˙rx* {°dONLNd¥ÑÏ+ <if ( (response & (1L << gestaltHasFileSystemManager)) != 0 )°dONLNdÛÑä* {°dONLNd¯ñ*Œ+ 4/* We require File System Manager 1.1 features so */°dONLNd0*ñ6P* /* check the version of FSM. */°dONLNdS6ñB‘* 5if ( Gestalt(gestaltFSMVersion, &response) == noErr )°dONLNdåBñNú* {°dONLNdíN®Z¯+ 8/* Make sure we have File System Manager 1.2 or later */°dONLNdœZ®fí* 'if ( (unsigned long)response >= 0x0120)°dONLNd¸f∫r+ result = true;°dONLNdrñ~ú({ñ}°dONLNd~Ñää(áÑ}°dONLNdärñx(ìr}°dONLNdñr¢fi* return ( result );°dONLNd+¢`Æf(´`},     Helvetica
  3046. °dONLNd-Õ`‹l*-&Installing and Enabling a Foreign File°dONLNdT€`Íï*System Í^ͧ
  3047. °dONLNd[˜`*^Installation of foreign file systems will usually be accomplished by a system extension (INIT)°dONLNd∫`* \file’s code at startup time. The mechanism that executes a system extension (commonly called°dONLNd`Í* Pthe INIT 31 mechanism) is described in Chapter 29 “The System Resource File” in °dONLNdgÍ(ÍInside°dONLNdn`'»($`Macintosh Volume IV°dONLNdÅ»'Ç)h', in Chapter 19 “The Start Manager” in °dONLNd®Ç')∫Inside Macintosh Volume V°dONLNd¡'
  3048. )Ñ,°dONLNd√'`3Ä(0`and in °dONLNd 'Ä3S) ,Inside Macintosh: Operating System Utilities°dONLNdˆ'S3)”%. The INIT 31 mechanism will load and°dONLNd3`?˙(<`[execute the foreign file system installation code in an 'INIT' resource in the foreign file°dONLNdx?`Kó* system file.°dONLNdÖW`c*_The installation can also be done from within an application if precautions are taken to ensure°dONLNdÂc`o* cthe foreign file system is installed in the system heap, or if installed in the application’s heap,°dONLNdIo`{* Xthat all volume are unmounted and the foreign file system removed before the application°dONLNd¢{`á{* quits.+˜nUsing the File System Manager)Æ1-)
  3049. 11ˇ    Jdˇ ˇˇˇˇd
  3050. d,Times
  3051. .+H3 Guide to the File System Manager°dONLNdUHaˇ*+]If the File System Manager is available (see the section, Ensuring the File System Manager is°dONLNd^aHm¸* aAvailable) then the foreign file system installation code should install the foreign file system.°dONLNd¿mHy˘* aTo install a foreign file system, the foreign file system initialization code must allocate space°dONLNd"yHÖ˜* [for the global data area, load and detach the code resource for the FSM component interface°dONLNd~ÖHëÛ* \processing function, initialize the fields of an FSDRec, and call InstallFS to add an FSD to°dONLNd€ëHùı* [the File System Manager’s FSD queue. If InstallFS is successful, the foreign file system is°dONLNd7ùH©˚* `installed with its component interfaces disabled. Once the foreign file system is installed, the°dONLNdò©HµË* \next step is to initialize the component interface records in the FSD to let the File System°dONLNdıµH¡v* @Manager know the features the foreign file system is capable of.°dONLNd6ÕHŸ”*TAll foreign file systems must support the HFS component interface. To initialize the°dONLNdãŸH¸* VHFSCIRec in the FSD, the installation code should set the hfsCIDoesDynamicLoadMask bit°dONLNd‚ÂHÒ⁄* Rin the compInterfMask field of the HFSCIRec. The File System Manager will call the°dONLNd5ÒH˝˚* VfsdCommProc function with a ffsLoadMessage when it needs the foreign file system’s HFS°dONLNdå˝H    Ê*  component interface code loaded.°dONLNd≠H!›*YIf the foreign file system supports the Disk Initialization component interface, then the°dONLNd!H-ˇ* ainstallation code needs to load and detach the foreign file system’s disk initialization code and°dONLNdi-H9Æ* Mdata, and then enable the Disk Initialization component interface in the FSD.°dONLNd∑EHQ»*WIf the foreign file system is successfully installed, the installation code should call°dONLNdQH]ˆ* NInformFSM with a fsmDrvQElChangedMessage message to mount any volumes owned by°dONLNd^]HiF* 8the foreign file system that might already be in drives.(ÚH1-)
  3052. 12)&Using the File System Managerˇ dˇ ˇˇˇˇd
  3053. d,Times
  3054. .(3¢The File System Manager,     Helvetica
  3055. °dONLNds`DZ(~`$FILE SYSTEM MANAGER SERVICE ROUTINES l^l Ö^Ö
  3056. °dONLNd%ú`®
  3057. *'XSix FSM service routines are provided by the File System Manager. These service routines°dONLNd~®`¥ˆ* Wlet you install, access, maintain and remove the information in the FSDs, send the File°dONLNd÷¥`¿* YSystem Manager messages, and send file system specific messages to a foreign file system.°dONLNd0¿`ÃG* 1The FSM service routines are listed in Table 1-3.°dONLNdbÿ`‰*Table
  3058.     °dONLNdgŸ‰Å) 
  3059. °dONLNdhÿʼnô)1-3.°dONLNdmÿ®‰_)'$File System Manager Service Routines°dONLNdíÔ`˚Ä(¯`Name°dONLNdóÔ®˚÷)HPurpose Ë^˰dONLNdü`ã(`    InstallFS°dONLNd©®¬)H6Adds a new FSD to the File System Manager’s FSD queue.°dONLNd·`+ï((`RemoveFS°dONLNdÍ®+Ã)H7Removes a FSD from the File System Manager’s FSD queue.°dONLNd#7`Cì(@`    GetFSInfo°dONLNd-7®C‰)HFReturns the FSD for a specific foreign file system or all foreign file°dONLNdtC®O“* systems.°dONLNd~[`gë(d`    SetFSInfo°dONLNdà[®g©)H5Changes the FSD information of a foreign file system.°dONLNdøs`ô(|`    InformFSM°dONLNd…s®¥)H6Sends messages or requests to the File System Manager.°dONLNdã`óñ(î`    InformFFS°dONLNd ã®ó»)H>Sends a file system specific message to a foreign file system.°dONLNdK£`Ø
  3060. (¨`UAll of the FSM service routines execute synchronously. GetFSInfo and SetFSInfo may be°dONLNd°Ø`ª* Ycalled at any time. InstallFS, RemoveFS, and InformFSM cannot be called by code executing°dONLNd˚ª`«* Nat interrupt time — they may make Memory Manager requests that move memory, or°dONLNdJ«`”* Ysynchronous operating system requests. Note that the File System Manager service routines°dONLNd§”`fl˚* Xare not Macintosh file system routines and are not controlled by the file system queuing°dONLNd˝fl`Îô*
  3061. mechanism.
  3062. °dONLNd`†*&    InstallFS ^§
  3063. °dONLNd`+»*MUse the InstallFS function to add a new file system descriptor to the system.,
  3064. Courier
  3065. °dONLNd`8`D\**pascal short InstallFS (FSDRecPtr fsdPtr);
  3066. °dONLNdãO`[}*fsdPtr°dONLNdíOÃ[)lBContains a pointer to an FSDRec initialized with the data you want°dONLNd’[Ãg* Hcopied to the file system descriptor InstallFS creates in the FSD queue.+ié$File System Manager Service Routines)–1-)
  3067. 13ˇˆdˇ ˇˇˇˇd
  3068. d,Times
  3069. .+H3 Guide to the File System Manager°dONLNdiTuü+ ?
  3070. fsdPtr record,    Symbol°dONLNduTÜ`*ưdONLNdygÖó)    fsdLength°dONLNdyÿÖ)qshort°dONLNd y;Öÿ)c Contains the size of the FSDRec.°dONLNdEÜ;í‚*
  3071.  Should always be sizeof(FSDRec).°dONLNdfíT£`(üTưdONLNdhñg¢õ)
  3072. fsdVersion°dONLNdsñÿ¢)qshort°dONLNdyñ;¢Í)c#Contains the minimum version of the°dONLNd°£;ØÍ*
  3073. %File System Manager this foreign file°dONLNdÀØ;ª‰* $system will work with. For the first°dONLNdÙª;«≥* release, use fsdVersion1.°dONLNd«Tÿ`(‘TưdONLNdÀg◊≥)fileSystemFSID°dONLNdÀÿ◊)qshort°dONLNd%À;◊fi)c"Contains the unique file system ID°dONLNdLÿ;‰⁄*
  3074. "(FSID) of the foreign file system.°dONLNdo‰Tı`(ÒTưdONLNdqËgÙµ)fileSystemName°dONLNdÄËÿÙÚ)qStr31°dONLNdÜË;Ù)c&Conatins a Pascal string which is used°dONLNd±ı;Ê*
  3075. &to identify the foreign file system by°dONLNd‹;
  3076. X* name.°dONLNd‚
  3077. T`(TưdONLNd‰gÃ)fileSystemGlobalsPtr°dONLNd˘ÿÊ)qPtr°dONLNd˝;Â)c&Contains a pointer to the foreign file°dONLNd(;*fi*
  3078. #system’s optional global data area.°dONLNdL*T;`(7TưdONLNdN.g:œ)fileSystemCommProc°dONLNda.ÿ:%)q
  3079. FSDCommUPP°dONLNdl.;:Â)c&Contains a pointer to the foreign file°dONLNdó;;G„*
  3080. !system’s communications function.°dONLNdπGTX`(TTưdONLNdªKgWï)    reserved3°dONLNd≈KÿWÌ)qlong°dONLNd K;Wπ)cReserved field. Must be 0.°dONLNdÂXTi`(eTưdONLNdÁ\ghï)    reserved2°dONLNdÒ\ÿhÌ)qlong°dONLNdˆ\;hπ)cReserved field. Must be 0.°dONLNdiTz`(vTưdONLNdmgyï)    reserved1°dONLNdmÿyÌ)qlong°dONLNd"m;yπ)cReserved field. Must be 0.°dONLNd=zTã`(áTưdONLNd?~gäô)fsdHFSCI°dONLNdH~ÿä
  3081. )qHFSCIRec°dONLNdQ~;äÙ)c&Contains the foreign file system’s HFS°dONLNd|ã;óø*
  3082. component interface record.°dONLNdòóT®`(§TưdONLNdöõgßé)fsdDICI°dONLNd¢õÿß)qDICIRec°dONLNd™õ;ßÛ)c'Contains the foreign file system’s Disk°dONLNd÷®;¥◊*
  3083. "Initialization component interface°dONLNd˝¥;¿]* record.°dONLNd–H‹≤(ŸHThe InstallFS function°dONLNdËTÙX+ •°dONLNdËaÙ&)
  3084. )validates the FSDRec pointed to by fsdptr°dONLNdHT X(    T•°dONLNdJa )
  3085. &allocates a new file system descriptor°dONLNdqT$X(!T•°dONLNdsa$∑)
  3086. Hcopies the FSDRec pointed to by fsdptr to the new file system descriptor°dONLNdº0T<X(9T•°dONLNdæ0a<ÿ)
  3087. Lclears the fsdHFSCI and fsdDICI compInterfMask fields in the new file system°dONLNd <aHê*
  3088. descriptor°dONLNdTT`X(]T•°dONLNdTa`ÿ)
  3089. Sinitializes fileSystemSpec in the new file system descriptor to the location of the°dONLNdl`al* &resource file referenced by CurResFile°dONLNdìxTÑX(ÅT•°dONLNdïxaÑÃ)
  3090. Jadds the new file system descriptor to the File System Manager’s FSD queue°dONLNd‡êHú¯(ôHWNote that the FSDRec passed by fsdptr is only copied by InstallFS. The FSDRec passed by°dONLNd8úH®ï* Cfsdptr does not become part of the File System Manager’s FSD queue.*M1-)
  3091. 14)&$File System Manager Service Routinesˇ hdˇ ˇˇˇˇd
  3092. d,Times
  3093. .(3¢The File System Manager°dONLNdilu®(rl Result codes°dONLNd
  3094. uÅö+ noErr°dONLNduÅ)è0°dONLNdu3Å\)%No error°dONLNdÅç‰(äfsmBadFFSNameErr°dONLNd/Şç)-433°dONLNd4Å3ç˜)5(length of fsdPtr->fileSystemName is 0 or°dONLNd`ç3ôy* greater than 31°dONLNdpô•€(¢fsmBadFSDLenErr°dONLNdÄô˛•)-434°dONLNdÖô3•‰)5'The file system descriptor is too large°dONLNd∞•3±‘* "(fsdPtr->fsdLength is greater than°dONLNd÷±3ΩÉ* sizeof(FSDRec))°dONLNdÊΩ…Ê(ΔfsmDuplicateFSIDErr°dONLNd˙Ω˛…)-435°dONLNdˇΩ3…)5*An FSD with fsdPtr->fileSystemFSID already°dONLNd-…3’í* exists in FSD queue°dONLNdA’·Ó(fifsmBadFSDVersionErr°dONLNdU’˛·)-436°dONLNdZ’3·Â)5&fsdPtr->fsdVersion is greater than the°dONLNdÑ·3ÌΩ* File System Manager version°dONLNd†Ì˘∏(ˆ
  3095. memFullErr°dONLNd´Ì˛˘)-108°dONLNd∞Ì3˘)5+The new file system descriptor could not be°dONLNdfl˘3\*     allocated,     Helvetica
  3096. °dONLNdÈ'`6Ø(2`RemoveFS 6^6§
  3097. °dONLNdÚC`OÊ*OUse the RemoveFS function to remove file system descriptor from the File System°dONLNdBO`[Œ* Manager’s FSD queue.,
  3098. Courier
  3099. °dONLNdWh`t2*#pascal short RemoveFS (short fsid);
  3100. °dONLNd{`ãr*fsid°dONLNdÄÃã)lEContains the unique file system ID (FSID) of the foreign file system.°dONLNdΔù`©(¶`SRemoveFS removes the FSD specified by fsid from the File System Manager’s FSD queue°dONLNd©`µÌ* Sand deallocates the memory allocated by the File System Manager for the file system°dONLNdnµ`¡˚* Vdescriptor. The file system descriptor can be removed only if all volumes owned by the°dONLNd≈¡`Õ¯* Uforeign file system are unmounted and all FSM component interfaces in the file system°dONLNdÕ`Ÿ–* descriptor are not busy.°dONLNd4Ìl˘®+   Result codes°dONLNdA˘¢+
  3101. noErr°dONLNdG˙)è0°dONLNdI˙3\)%No error°dONLNdRŒ(
  3102. fsmBusyFFSErr°dONLNd`˛)-432°dONLNde3Ò)5'A volume with the fsid is mounted or an°dONLNdê3◊*  FSM component interfaces is busy°dONLNd±*Ê('fsmFFSNotFoundErr°dONLNd√˛*)-431°dONLNd»3*)5,The file system descriptor with fsid was not°dONLNd¯*36§* found in the FSD queue
  3103. °dONLNdX`g™(c`    GetFSInfo g^g§
  3104. °dONLNdt`į*WUse the GetFSInfo function to get a copy of a file system descriptor in the File System°dONLNdqÄ`åŒ* Manager’s FSD queue.
  3105. °dONLNdÜô`•Ï*Bpascal short GetFSInfo (short selector, short key, short *bufSize,°dONLNd–•˜±c+ó FSDRecPtr fsdptr);
  3106. +>D$File System Manager Service Routines)–1-)
  3107. 15ˇÚdˇ ˇˇˇˇd
  3108. d,Times
  3109. .+H3 Guide to the File System Manager°dONLNdWHcl*-selector°dONLNd    W¥c‘)l>Contains the method used to select the file system descriptor.°dONLNdHkHwY(tHkey°dONLNdLk¥w¬)l;Contains the key used to select the file system descriptor.°dONLNdàHãl(àHbufSize°dONLNdê¥ãÌ)lFContains a pointer to a short. On input, the field referred to by this°dONLNd◊ã¥ó„* Bparameter contains the size of the buffer pointed to by fsdPtr; on°dONLNdó¥£* Eoutput, GetFSInfo places the number of bytes actually copied from the°dONLNd`£¥ØÎ* Gfile system descriptor to the buffer into the field referred to by this°dONLNd®Ø¥ªÊ*
  3110. parameter.°dONLNd≥√Hœe(ÃHfsdPtr°dONLNd∫√¥œ„)l>Contains pointer to a FSDRec. GetFSInfo copies the file system°dONLNd˘œ¥€¿* 9descriptor into the FSDRec referred to by this parameter.°dONLNd3ÌH˘Ò(ˆHXThe GetFSInfo function returns a copy of an file system descriptor in the FSD queue. The°dONLNdå˘Hµ* OGetFSInfo function selects the file system descriptor according to these rules:°dONLNd‹TX+ •°dONLNdfia‡)
  3111. PIf selector is fsmGetFSInfoByIndex, GetFSInfo returns returns a copy of the file°dONLNd/a)* Vsystem descriptor whose position in the FSD queue is specified by the key parameter. A°dONLNdÜ)a5√* Mkey of 0 returns a copy of the first file system descriptor in the FSD queue.°dONLNd‘ATMX(JT•°dONLNd÷AaMfl)
  3112. OIf selector is fsmGetFSInfoByFSID, GetFSInfo returns returns a copy of the file°dONLNd&MaY¡* Isystem descriptor whose File System ID is specified by the key parameter.°dONLNdpeTqX(nT•°dONLNdreaqÓ)
  3113. QIf selector is fsmGetFSInfoByRefNum, GetFSInfo returns returns a copy of the file°dONLNdƒqa}›* Psystem descriptor using the volume or file reference number specified by the key°dONLNd}aâˇ* Uparameter. The key parameter must be a valid file or volume reference number and must°dONLNdkâaï”* Obe a file or volume owned by a foreign file system installed by the File System°dONLNdªïa°é* Manager.°dONLNdƒµT¡ê(æT Result codes°dONLNd—¡gÕÇ+ noErr°dONLNd◊¡ˆÕ¸)è0°dONLNdŸ¡ÕD)%No error°dONLNd‚ÕgŸñ(÷grfNumErr°dONLNdÎÕÏŸ¸)Ö-51°dONLNdÔÕŸÍ)/*The key was an invalid reference number or°dONLNdŸÂfi* )referenced a volume not controlled by the°dONLNdJÂÒ* File System Manager°dONLNd^Òg˝Œ(˙gfsmFFSNotFoundErr°dONLNdpÒÊ˝¸)-431°dONLNduÒ˝˜)5/The file system descriptor with the FSID, or at°dONLNd®˝    ◊* (the specified index was not found in the°dONLNd‘    P*     FSD queue,     Helvetica
  3114. °dONLNdfi7HFê(BH    SetFSInfo FFFå
  3115. °dONLNdËSH_˜*ZUse the SetFSInfo function to change a file system descriptor in the File System Manager’s°dONLNdC_HkÅ*
  3116. FSD queue.,
  3117. Courier
  3118. °dONLNdNxHÑÊ*Epascal short SetFSInfo (short fsid, short bufSize, FSDRecPtr fsdptr);
  3119. °dONLNdîèHõZ*fsid°dONLNdôè¥õ˘)lEContains the unique file system ID (FSID) of the foreign file system.°dONLNdfl£HØl(¨HbufSize°dONLNdÁ£¥Øß)l5Contains the size of the buffer pointed to by fsdPtr.°dONLNd∑H√e(¿HfsdPtr°dONLNd$∑¥√Ú)lCContains a pointer to an FSDRec containing the data to be copied to°dONLNdh√¥œ.* the file system descriptor.(ÚH1-)
  3120. 16)&$File System Manager Service Routinesˇ ¯dˇ ˇˇˇˇd
  3121. d,Times
  3122. .(3¢The File System Manager°dONLNdU`a(^`]SetFSInfo changes the file system descriptor specified by the fsid parameter. This routine is°dONLNd^a`m* [normally used following InstallFS to enable the foreign file system’s component interfaces.°dONLNd∫m`y* \bufSize bytes are copied to the file system descriptor from the buffer pointed to by fsdPtr.°dONLNdy`Ö* VThe fsdLink, fsdLength, fsdVersion, fileSystemFSID, fileSystemName, and fileSystemSpec°dONLNdnÖ`ëñ* Cfields in the file system descriptor are not modified by SetFSInfo.°dONLNd≤•l±®+   Result codes°dONLNdø±Ωö+ noErr°dONLNd≈±Ω)è0°dONLNd«±3Ω\)%No error°dONLNd–Ω…Ê(ΔfsmFFSNotFoundErr°dONLNd‚Ω˛…)-431°dONLNdÁΩ3…)5(The file system descriptor with fsid was°dONLNd…3’∂* not found in the FSD queue°dONLNd.’·Œ(fi
  3123. fsmBusyFFSErr°dONLNd<’˛·)-432°dONLNdA’3·¸)5(An FSM component interfaces is busy; the°dONLNdm·3Ìı* )file system descriptor cannot be modified°dONLNdóÌ˘€(ˆfsmBadFSDLenErr°dONLNdßÌ˛˘)-434°dONLNd¨Ì3˘)5+The number of bytes specified by bufSize is°dONLNd€˘3Á* (larger than the file system descriptor’s°dONLNd3{* fsdLength field°dONLNdÛ(fsmNoAlternateStackErr°dONLNd.˛)-437°dONLNd33)5/An attempt was made to enable the file system’s°dONLNde3)* .HFS component interface but no alternate stack°dONLNdó)35‹*  was provided in fsdPtr->fsdHFSCI,     Helvetica
  3124. °dONLNd∏W`f∞(b`    InformFSM f^f§
  3125. °dONLNd¬s`À*GUse the InformFSM function to communicate with the File System Manager.,
  3126. Courier
  3127. °dONLNd
  3128. å`ò»*<pascal short InformFSM (short theMessage, void *paramBlock);
  3129. °dONLNdG£`Øó*
  3130. theMessage°dONLNdR£ÃØfl)l8Contains the message to send to the File System Manager.°dONLNdã∑`√ô(¿`
  3131. paramBlock°dONLNdñ∑Ã√√)l5Contains a pointer to optional message specific data.°dONLNdÃ’`·Ï(fi`PInformFSM passes a message and optional message-specific data to the File System°dONLNd·`̯* MManager. The File System Manager will return an fsmUnknownFSMMessageErr if an°dONLNdkÌ`˘Ï* Nundefined message is passed. The currently defined messages are fsmNopMessage,°dONLNd∫˘`
  3132. * MfsmDrvQElChangedMessage, and fsmGetFSIconMessage. How the File System Manager°dONLNd`
  3133. * Yhandles each message and what result codes can be returned are described in the following°dONLNdb`ò* paragraphs.
  3134. °dONLNdn/`>ÿ* 
  3135. fsmNopMessage°dONLNd{/ÿ>Ò)x (0)
  3136. °dONLNdÄI`U(R`XThe File System Manager does nothing. The paramBlock parameter is ignored and the result°dONLNdŸU`aÆ* is always noErr.°dONLNdÍulÅ®+   Result codes°dONLNd˜Åçö+ noErr°dONLNd˝Å)ç/)™0°dONLNdˇÅ<çe)No error(Ú5$File System Manager Service Routines)–1-)
  3137. 17ˇ    dˇ ˇˇˇˇd
  3138. d,Times
  3139. .+H3 Guide to the File System Manager,     Helvetica
  3140. °dONLNdUHd*-fsmDrvQElChangedMessage°dONLNdUd0)œ (1)
  3141. °dONLNdoH{˝(xHWThe fsmDrvQElChangedMessage tells the File System Manager to search the drive queue for°dONLNdt{Háˇ* Zunmounted volumes and attempt to find a File System Manager controlled foreign file system°dONLNdœáHìÙ* [that can mount the volume. If a foreign file system is found that can mount the volume, the°dONLNd+ìHü* [File System Manager will issue a diskInsertEvt for the drive so the foreign file system can°dONLNdáüH´°* mount the volume.°dONLNdô∑T√s+ Note:°dONLNdû∑s√fl)J Drive queue elements with the value fsmIgnoreFSID in the dQFSID field are°dONLNdÈ√Tœ»(ÃTJignored by the File System Manager when it searches for unmounted volumes.°dONLNd4·HÌÀ(ÍHRThis message can be sent by a disk driver to notify the File System Manager that a°dONLNdáÌH˘ı* Xunmounted disk has a non-HFS partition. Before sending this message, the disk driver has°dONLNd‡˘HÍ* [allocated a drive queue element for the partition and added it to the system’s drive queue.°dONLNd<H¸*]This message is also sent by a foreign file system’s installation code to check for unmounted°dONLNdöH)* /disks after a foreign file system is installed.°dONLNd 5HAÄ*@The paramBlock parameter is ignored. The result is always noErr.°dONLNd MTYw+ Note: °dONLNdMwY·)#IThis message can cause memory to move. A disk driver can safely make this°dONLNd[YTe˘(bT#request only at driver accRun time.°dONLNdTãê*& Result codes°dONLNdåãgóÇ+ noErr°dONLNdíãó)™0°dONLNdîã$óM)No error
  3142. °dONLNdù≥H¬(æHfsmGetFSIconMessage°dONLNd∞≥¬    )® (2)
  3143. °dONLNdµÕHŸ˙(÷HYThe fsmGetFSIconMessage tells the File System Manager to get a foreign file system’s disk°dONLNdŸHÂm* 9icon. The paramBlock parameter points to a FSMGetIconRec.(ÚH1-)
  3144. 18)&$File System Manager Service RoutinesˇÊdˇ ˇˇˇˇd
  3145. d,Times
  3146. .(3¢The File System Manager°dONLNdilu…(rl
  3147. FSMGetIconRec,    Symbol°dONLNdulÜx*ưdONLNdyÖ§)refNum°dONLNdyÁÖˇ)hshort°dONLNdy/ÖÛ)H(Contains the target drive number, volume°dONLNdJÜ/íÍ*
  3148. &reference number, or working directory°dONLNduí/ûS* number°dONLNd|ûlØx(´lưdONLNd~¢Æ¿)
  3149. iconBufferPtr°dONLNdå¢ÁÆı)hPtr°dONLNdê¢/Æ
  3150. )H/Contains a pointer to the icon buffer where the°dONLNdƒØ/ª˘*
  3151. -foreign file system will return the icon data°dONLNdÚªlÃx(»lưdONLNdÙøÀµ) requestSize°dONLNdøÁÀ¸)hlong°dONLNdø/Àˇ)H-Contains the size of the supplied icon buffer°dONLNd3Ãl›x(Ÿl¨°dONLNd5–‹Æ)
  3152. actualSize°dONLNd@–Á‹¸)hlong°dONLNdE–/‹)H/The foreign file system returns the actual size°dONLNdy›/ÈØ*
  3153. of the icon data in this field°dONLNdòÈl˙x(ˆlưdONLNdöÌ˘´)iconType°dONLNd£ÌÁ˘˚)hchar°dONLNd®Ì/˘÷)H#Contains the kind of icon requested°dONLNdÃ˙l x(l¨°dONLNdŒ˛
  3154. ±) isEjectable°dONLNd⁄˛Á
  3155. )hBoolean°dONLNd‚˛/
  3156. )H,The File System Manager returns true in this°dONLNd /∂*
  3157.  field if the device is ejectable°dONLNd4l(x($l¨°dONLNd6'≈)
  3158. driveQElemPtr°dONLNdDÁ')h    DrvQElPtr°dONLNdN/')H,The File System Manager returns a pointer to°dONLNd(/4¿*
  3159.  the drive’s DrvQEl in this field°dONLNd†4lEx(Al¨°dONLNd¢8D÷)fileSystemSpecPtr°dONLNd¥8ÁD)h    FSSpecPtr°dONLNdæ8/D)H,The File System Manager returns a pointer to°dONLNdÔE/Q*
  3160. *foreign file system’s FSSpec in this field°dONLNdQlbx(^lưdONLNdUa≠)    reserved1°dONLNd&UÁa¸)hlong°dONLNd+U/aö)Hreserved, must be zero°dONLNdBr`~({`YThe refNum field must contain the target drive number, volume reference number or working°dONLNdú~`ä* Ydirectory number. The iconBufferPtr field must point to the buffer where the icon will be°dONLNdˆä`ñÔ* Vreturned. The requestSize field must contain the size of the supplied icon buffer. The°dONLNdMñ`¢d* 7iconType field must contain the kind of icon requested.°dONLNdÖÆ`∫ˇ*VThe icon kinds supported and their sizes are those used by the Desktop Manager and are°dONLNd‹∫`Δπ* listed in Table 1-4.°dONLNdÒ“`fi*Table
  3161.     °dONLNdˆ”fiÅ) 
  3162. °dONLNd˜“Åfiô)1-4.°dONLNd¸“®fi›)'
  3163. Icon Types°dONLNdÈÃı¸+$Value or ‚^‚°dONLNdıÃ˘* bytes in°dONLNdıV)6
  3164. Corresponding°dONLNd+`
  3165. í(
  3166. `Constant°dONLNd4Ã
  3167. Ú)lbitmap°dONLNd;
  3168. N)6
  3169. resource type°dONLNdI`
  3170. °)^ Description°dONLNdU`%ñ("`
  3171. kLargeIcon°dONLNd`%`1™* kLarge4BitIcon°dONLNdo1`=™* kLarge8BitIcon°dONLNd~=`Iñ*
  3172. kSmallIcon°dONLNdâI`U™* kSmall4BitIcon°dONLNdòU`a™* kSmall8BitIcon°dONLNdßÃ%“("Ã1°dONLNd©%Ã1“* 2°dONLNd´1Ã=“* 3°dONLNd≠=ÃI“* 4°dONLNdØIÃU“* 5°dONLNd±UÃa“* 6°dONLNd≥%'("'ICN#'°dONLNd∫%1* 'icl4'°dONLNd¡1=* 'icl8'°dONLNd»=I* 'ics#'°dONLNdœIU* 'ics4'°dONLNd÷Ua* 'ics8'°dONLNd›`%ˇ("`Large black & white icon w/mask°dONLNd˝%`1Δ* Large 4-bit color icon°dONLNd1`=Δ* Large 8-bit color icon°dONLNd+=`I    * !Small black-and-white icon w/mask°dONLNdMI`UΔ* Small 4-bit color icon°dONLNddU`aΔ* Small 8-bit color icon°dONLNd|m`y™(v`kLargeIconSize°dONLNdãy`Öæ* kLarge4BitIconSize°dONLNdûÖ`ëæ* kLarge8BitIconSize°dONLNd±ë`ù™* kSmallIconSize°dONLNd¿ù`©æ* kSmall4BitIconSize°dONLNd”©`µæ* kSmall8BitIconSize°dONLNdÊmÃyfi(vÃ256°dONLNdÍyÃÖfi* 512°dONLNdÓÖÃë‰* 1024°dONLNdÛëÃùÿ* 64°dONLNdˆùéfi* 128°dONLNd˙©Ãµfi* 256°dONLNd˛my'(v'ICN#'°dONLNdyÖ* 'icl4'°dONLNd Öë* 'icl8'°dONLNdëù* 'ics#'°dONLNdù©* 'ics4'°dONLNd!©µ* 'ics8'°dONLNd(m`y¸(v`Large black &white icon w/mask°dONLNdGy`ÖΔ* Large 4-bit color icon°dONLNd^Ö`ëΔ* Large 8-bit color icon°dONLNduë`ù    * !Small black-and-white icon w/mask°dONLNdóù`©Δ* Small 4-bit color icon°dONLNdÆ©`µΔ* Small 8-bit color icon(Ú5$File System Manager Service Routines)–1-)
  3173. 19ˇ 2dˇ ˇˇˇˇd
  3174. d,Times
  3175. .+H3 Guide to the File System Manager°dONLNdUHaË*+SThe File System Manager uses the refNum field in the FSMGetIconRec to determine the°dONLNdTaHm˘* ]drive and the foreign file system that owns the drive. Then, the File System Manager fills in°dONLNd≤mHyÎ* Uthe isEjectable, driveQElemPtr, and fileSystemSpecPtr fields in the FSMGetIconRec and°dONLNdyHÖÒ* Upasses the FSMGetIconRec to the foreign file system with a ffsGetIconMessage message.°dONLNd^ëHùfi*YThe foreign file system is responsible for returning the icon in the buffer pointed to by°dONLNd∏ùH©Á* ]iconBufferPtr and the icon data size in the actualSize field. See the description of the file°dONLNd©Hµµ* Hsystem communications function’s ffsGetIconMessage for more information.°dONLNd_…T’ê+   Result codes°dONLNdl’g·Ç+ noErr°dONLNdr’·)™0°dONLNdt’$·M)No error°dONLNd}·gÌá(ÍgnsvErr°dONLNdÑ·Ì)†-35°dONLNdà·$ÌÒ)'refNum in FSMGetIconRec did not specify°dONLNd≥Ì$˘O* a volume°dONLNdº˘gì(gnsDrvErr°dONLNd≈˘)†-56°dONLNd…˘$Ò)'refNum in FSMGetIconRec did not specify°dONLNdÙ$D* a drive°dONLNd¸gº(gafpItemNotFound°dONLNd ˚)î-5012°dONLNd$)),The foreign file system could not return the°dONLNdB$)* icon type requested°dONLNdV)g5^(2g2any of the result codes returned by FSpOpenResFile,     Helvetica
  3176. °dONLNdâWHfï(bH    InformFFS fFfå
  3177. °dONLNdìsH‚*TUse the InformFFS function to communicate with foreign file systems through the File°dONLNdËHãõ* System Manager.,
  3178. Courier
  3179. °dONLNd¯òH§Ü*5pascal short InformFFS(short fsid, void *paramBlock);
  3180. °dONLNd.ØHªZ*fsid°dONLNd3Ø¥ª˘)lEContains the unique file system ID (FSID) of the foreign file system.°dONLNdy√HœÅ(ÃH
  3181. paramBlock°dONLNdÑ√¥œ´)l5Contains a pointer to optional message specific data.°dONLNd∫·HÌÎ(ÍHUInformFFS passes a message through the File System Manager to the foreign file system°dONLNdÌH˘”* Uspecified by fsid. The message data structure is defined by each foreign file system.°dONLNdf
  3182. Tê+   Result codes°dONLNdsg%Ç+ noErr°dONLNdyˆ%¸)è0°dONLNd{%D)%No error°dONLNdÑ%g1Œ(.gfsmFFSNotFoundErr°dONLNdñ%Ê1¸)-431°dONLNdõ%1ÿ)5(The file system descriptor with fsid was°dONLNd«1=û* not found in the FSD queue(ÚH1-)
  3183. 20)&$File System Manager Service Routinesˇ ädˇ ˇˇˇˇd
  3184. d,Times
  3185. .(-¢The File System Manager,     Helvetica
  3186. °dONLNds`ÇÆ(~`$FOREIGN FILE SYSTEM-DEFINED ROUTINES l^l Ö^Ö°dONLNd%®`∑s*5#File System Communications Function ∑^∑§
  3187. °dONLNdIƒ`–*TThe communications function pointed to by fileSystemCommProc in an FSDRec is used by°dONLNdû–`‹∂* Fthe File System Manager to communicate with a foreign file system. The°dONLNd‹`Ë[* 0fileSystemCommProc must have the following form.,
  3188. Courier
  3189. °dONLNdı`»*<pascal OSErr MyFSDCommProc (short message, void *paramBlock,°dONLNd[
  3190. Å+µ void *globalsPtr);
  3191. °dONLNdn`$à(!`message°dONLNdvÃ$·)l;Contains the message being sent to the foreign file system.°dONLNd≤,`8ô(5`
  3192. paramBlock°dONLNdΩ,Ã8)lCContains a pointer to a buffer containing any additional parameters°dONLNd8ÃD`* needed to process the message.°dONLNd L`Xê(U`
  3193. globalsPtr°dONLNd+LÃX)lDContains a pointer to the foreign file system’s optional global data°dONLNdpXÃd„* area.°dONLNdvv`Ç(`\When the file system communications function is called, it is passed a message and a pointer°dONLNd”Ç`é* ]to a buffer containing any additional parameters needed to process the message. The currently°dONLNd1é`öÿ* Hdefined messages are ffsNopMessage, ffsGetIconMessage, ffsIDDiskMessage,°dONLNdzö`¶* QffsLoadMessage, ffsUnloadMessage, ffsIDVolMountMessage, and ffsInformMessage. How°dONLNdö`≤* Xthe file system communications function should handle each message and what result codes°dONLNd%≤`æ    * Zshould be returned are described in the following paragraphs. If the message passed is not°dONLNdÄæ` ¸* Vrecognized or handled by your file system communications function, the function result°dONLNd◊ `÷K* *returned must be fsmUnknownFSMMessageErr (°dONLNd K÷i)Î-438).°dONLNd‚lÓã(ÎlNote:°dONLNd
  3194. ‚ãÓ˚)O The file system communications function is not called at interrupt time. Thus,°dONLNd]Ól˙˚(˜lNit may make Memory Manager requests and synchronous operating system requests.
  3195. °dONLNd¨`!–(`
  3196. ffsNopMessage°dONLNdπ–!È)p (0)
  3197. °dONLNdæ,`8(5`WWhen the ffsNopMessage is passed to the file system communications function, do nothing°dONLNd8`D* $and always return a result of noErr.°dONLNd;Xld®+   Result codes°dONLNdHdpö+ noErr°dONLNdNdp)è0°dONLNdPd3p\)%No error
  3198. °dONLNdYå`õÏ(ó`ffsGetIconMessage°dONLNdjåÏõ)å (1)
  3199. °dONLNdo¶`≤È(Ø`OThe ffsGetIconMessage is passed to the file system communications function when°dONLNdø≤`æ* RInformFSM is called with fsmGetFSIconMessage. The paramBlock parameter points to a°dONLNdæ` ’* FSMGetIconRec record.+’*$File System Manager Service Routines)–1-)
  3200. 21ˇdˇ ˇˇˇˇd
  3201. d,Times
  3202. .+H- Guide to the File System Manager°dONLNdUTa±+ 1
  3203. FSMGetIconRec,    Symbol°dONLNdaTr`*ưdONLNdegqå)refNum°dONLNdeœqÁ)hshort°dONLNdeq€)H(Contains the target drive number, volume°dONLNdJr~“*
  3204. &reference number, or working directory°dONLNdu~ä;* number°dONLNd|äTõ`(óTưdONLNd~égö®)
  3205. iconBufferPtr°dONLNdåéœö›)hPtr°dONLNdêéöÚ)H/Contains a pointer to the icon buffer where the°dONLNdƒõß·*
  3206. -foreign file system will return the icon data°dONLNdÚßT∏`(¥TưdONLNdÙ´g∑ù) requestSize°dONLNd´œ∑‰)hlong°dONLNd´∑Á)H-Contains the size of the supplied icon buffer°dONLNd3∏T…`(≈T¨°dONLNd5ºg»ñ)
  3207. actualSize°dONLNd@ºœ»‰)hlong°dONLNdEº»Ï)H/The foreign file system returns the actual size°dONLNdy…’ó*
  3208. of the icon data in this field°dONLNdò’TÊ`(‚TưdONLNdöŸgÂì)iconType°dONLNd£ŸœÂ„)hchar°dONLNd®ŸÂæ)H#Contains the kind of icon requested°dONLNdÃÊT˜`(ÛTưdONLNdŒÍgˆô) isEjectable°dONLNd⁄Íœˆˆ)hBoolean°dONLNd‚͈»)H(Contains true if the device is ejectable°dONLNd ˜T`(TưdONLNd
  3209. ˚g≠)
  3210. driveQElemPtr°dONLNd˚œ)h    DrvQElPtr°dONLNd%˚’)H(Contains a pointer to the drive’s DrvQEl°dONLNdNT`(TưdONLNdP gæ)fileSystemSpecPtr°dONLNdb œ)h    FSSpecPtr°dONLNdl ›)H+Contains a pointer to foreign file system’s°dONLNdú%<*
  3211. FSSpec°dONLNd£%T6`(2TưdONLNd•)g5ï)    reserved1°dONLNdØ)œ5‰)hlong°dONLNd¥)5Ç)Hreserved, must be zero°dONLNdÀFHRˆ(OHZYour foreign file system uses iconType to determine the type of icon requested. If a known°dONLNd&RH^æ* Ricon type is requested, open the foreign file system’s resource file (specified by°dONLNdy^Hj˝* ]fileSystemSpecPtr) with read-only access, get the specified icon resource, copy the icon data°dONLNd◊jHv„* Y(up to requestSize bytes) into the buffer pointed to by iconBufferPtr, and then close the°dONLNd1vHǯ* ^foreign file system’s resource file. Return the number of icon data bytes copied into into the°dONLNdêÇHé–* buffer in the actualSize field.°dONLNd∞¢TÆê+   Result codes°dONLNdΩÆg∫Ç+ noErr°dONLNd√ƈ∫¸)è0°dONLNd≈Æ∫D)%No error°dONLNdŒ∫gΔº(√gafpItemNotFound°dONLNdfi∫‡Δ¸)y-5012°dONLNd‰∫ΔÁ);*The icon type requested could not be found°dONLNdΔg“^(œg2any of the result codes returned by FSpOpenResFile,     Helvetica
  3212. °dONLNdBÓH˝ (˘HffsIDDiskMessage°dONLNdRÓ ˝„)Ç (2)
  3213. °dONLNdWHÛ(HWThe ffsIDDiskMessage is passed to the file system communications function when the File°dONLNdØH ›* WSystem Manager intercepts a MountVol request. If the idSector field in the foreign file°dONLNd H,Ù* Xsystem’s HFSCIRec is not -1, the paramBlock parameter points to the disk block specified°dONLNd`,H8‡* Yby the idSector field of the HFSCIRec. If the idSector field in the foreign file system’s°dONLNd∫8HDÙ* WHFSCIRec is -1, the paramBlock parameter points to the parameter block used to make the°dONLNdDHP* ZMountVol request and the ioVRefNum field in that parameter block contains the drive number°dONLNdmPH\∫* of the volume to mount.°dONLNdÖhHtÊ*YYour foreign file system should determine if the disk volume belongs to this foreign file°dONLNdfltHĘ* ]system and return noErr if it does. If the disk volume cannot be identified, return extFSErr.°dONLNd=åHò*]If your foreign file system returns noErr and its HFS component interface code is not loaded,°dONLNdõòH§º* Lthe File System Manager will send your foreign file system a ffsLoadMessage.*P1-)
  3214. 22)&$File System Manager Service Routinesˇ údˇ ˇˇˇˇd
  3215. d,Times
  3216. .(-¢The File System Manager°dONLNdilu®(rl Result codes°dONLNd
  3217. uÅö+ noErr°dONLNduÅ)è0°dONLNdu3Å)%,The disk volume belongs to this foreign file°dONLNdEÅ3çT* system°dONLNdLçô™(ñextFSErr°dONLNdUçô)Ö-58°dONLNdYç3ô)/'The disk volume does not belong to this°dONLNdÑô3•ã* foreign file system,     Helvetica
  3218. °dONLNdò¡`–◊(Ã`ffsLoadMessage°dONLNd¶¡◊–)w (3)
  3219. °dONLNd´€`Á(‰`UThe ffsLoadMessage is passed to the file system communications function when the File°dONLNdÁ`Û* [System Manager needs to call the HFS component interface code of a foreign file system that°dONLNd]Û`ˇ\* 4is not loaded. The paramBlock parameter is not used.°dONLNdí `*WYou should check to see if the HFS component interface code is loaded. If not, load and°dONLNdÍ`#˘* Vdetach the HFS component interface code and related data, allocate a stack for the HFS°dONLNdA#`/Δ* Kcomponent interface code’s use, initialize the HFSCIRec in the FSD, set the°dONLNdç/`;* VhfsCIResourceLoadedBit in the compInterfMask, activate the HFS component interface for°dONLNd‰;`G"* *the foreign file system, and return noErr.°dONLNdS`_*[If the HFS component interface code cannot be loaded, the stack cannot be allocated, or the°dONLNdk_`k˝* XHFS component interface for the foreign file system cannot be activated, return an error°dONLNdƒk`w~* result.°dONLNdÃãló®+   Result codes°dONLNdŸó£ö+ noErr°dONLNdfló£)è0°dONLNd·ó3£)%)No error; the HFS component interface was°dONLNd£3Øœ* !successfully loaded and activated°dONLNd0ت∏(∏
  3220. memFullErr°dONLNd;Ø˛ª)-108°dONLNd@Ø3ª…)5 The stack could not be allocated°dONLNdaª«
  3221. (ƒQany of the result codes returned by the Resource Manager, GetFSInfo, or SetFSInfo
  3222. °dONLNd≥„`ÚÊ(Ó`ffsUnloadMessage°dONLNd√„ÊÚˇ)Ü (4)
  3223. °dONLNd»˝`     (`WThe ffsUnloadMessage is passed to the file system communications function when the File°dONLNd     `Ú* NSystem Manager no longer needs the HFS component interface code in memory. The°dONLNdo`!* !paramBlock parameter is not used.°dONLNdë-`9*WYou should disable the HFS component interface, clear the hfsCIResourceLoadedBit in the°dONLNdÈ9`E* TcompInterfMask, make the HFS component interface code and related data purgable, and°dONLNd>E`Q_* 4dispose of the HFS component interface code’s stack.°dONLNdselq®+   Result codes°dONLNdÄq}ö+ noErr°dONLNdÜq})è0°dONLNdàq3})%)No error; the HFS component interface was°dONLNdµ}3âÊ* %successfully unloaded and deactivated°dONLNd€âïù(í;any of the result codes returned by GetFSInfo, or SetFSInfo+∂_$File System Manager Service Routines)–1-)
  3224. 23ˇ™dˇ ˇˇˇˇd
  3225. d,Times
  3226. .+H- Guide to the File System Manager,     Helvetica
  3227. °dONLNdUHdÔ*3ffsIDVolMountMessage°dONLNdUÔd)ß (5)
  3228. °dONLNdoH{˚(xHYThis message is passed to the file system communications function when the File Manager’s°dONLNds{Há* ^VolumeMount routine is called to give a foreign file system a chance to claim the request. The°dONLNd“áHìÓ* TparamBlock parameter points to parameter block used to make the VolumeMount request.°dONLNd'ìHüÍ* VThe ioBuffer field of the parameter block points to a VolumeMountInfoHeader structure.°dONLNd~≥Tø„+  VolumeMountInfoHeader,    Symbol°dONLNdîøT–`*ưdONLNdñ√gœÑ)length°dONLNdù√Ꜯ))short°dONLNd£√ÿœÒ)H:Contains the length in bytes of the entire VolumeMountInfo°dONLNd‚–ÿ‹‘*
  3229. 8record including this field and the variable length data°dONLNd‹ÿËI* following the flags field°dONLNd9ËT˘`(ıTưdONLNd;Ïg¯É)media°dONLNdAÏê¯Õ))
  3230. VolumeType°dONLNdLÏÿ¯ı)H:Contains the VolumeType of the media to mount. This is the°dONLNdã˘ÿ˝*
  3231. >creator type that you registered with Apple Computer, Inc. for°dONLNdŒÿ^* your file system ID number.°dONLNdÍT"a(T´°dONLNdÏg!~)flags°dONLNdÚê!®))short°dONLNd¯ÿ!x)H Contains the volume mount flags.°dONLNd"ÿ3‰*ưdONLNd&Í2I)volMountInteractBit°dONLNd2&V2˛)l(If set, it’s safe for the file system to°dONLNda3V?Ù*
  3232. !perform user interaction to mount°dONLNdâ?VKä*
  3233. the volume°dONLNdóKÿ\‰(Xÿ¨°dONLNdôOÍ[P)volMountChangedBit°dONLNd¨OV[ˆ)l#If set, the file system mounted the°dONLNd÷\Vhˆ*
  3234. volume, but the volume mounting°dONLNd¸hVtÊ* information record needs to be°dONLNd!tVÄ* updated.°dONLNd*êTús(ôTNote:°dONLNd/êsúÍ)I The VolumeMountInfoHeader record is a superset of the VolMountInfoHeader°dONLNdyúT®’(•TUrecord defined in Inside Macintosh: Files. In particular, the flags field used by the°dONLNdœ®T¥fl* OAppleShare file system was added to VolumeMountInfoHeader to allow foreign file°dONLNd¥T¿Œ* Ksystems to properly interact with the Alias Manager (the kARMNoUI rulesMask°dONLNdk¿TÉ* Upassed to MatchAlias is used to set or clear the volMountInteractBit; MatchAlias uses°dONLNd¡ÃTÿº* Ithe volMountChangedBit to determine the value returned in the needsUpdate°dONLNd ÿT‰ä* parameter).°dONLNdˆHË(ˇHTYou should compare the media field in the VolumeMountInfoHeader to your foreign file°dONLNdlH* Ysystem’s media type and return noEr if they match. If they do not match, return extFSErr.°dONLNdΔHÊ* WYour media type should be the creator type assigned when you register your foreign file°dONLNdH&ì* system’s FSID.°dONLNd-2H>*]If your foreign file system returns noErr and its HFS component interface code is not loaded,°dONLNdã>HJº* Lthe File System Manager will send your foreign file system a ffsLoadMessage.°dONLNdÿVHbÓ*TForeign file systems are called with the ffsIDVolMountMessage before the VolumeMount°dONLNd-bHn* `request is passed to the File Manager. If your foreign file system claims the request, it should°dONLNdénHzÍ* Zuse this time to load data or code resources and to perform any user interaction needed to°dONLNdÈzHÜ∫* Nmount the volume. User interface interactions should be performed only  if the°dONLNd    8ÜHí˝* bvolMountInteract bit is set in the flags field. When the volMountInteract bit is set, it indicates°dONLNd    õíHûÓ* Uthe caller of VolumeMount has initialized the QuickDraw, the Font Manager, the Window°dONLNd    ÒûH™z* <Manager, the Menu Manager, TextEdit, and the Dialog Manager.*J1-)
  3235. 24)&$File System Manager Service RoutinesˇXdˇ ˇˇˇˇd
  3236. d,Times
  3237. .(-¢The File System Manager°dONLNdU`a(^`VIf the volume can be mounted and the foreign file system detemines the volume mounting°dONLNdWa`mÃ* Ninformation record needs to be updated, the foriegn file system should set the°dONLNd¶m`y* XvolMountChangedBit to indicate to the caller that it should call GetVolMountInfoSize and°dONLNdˇy`Ö* TGetVolMountInfo to get an updated version of the volume mounting information record.°dONLNdTëlùã+ Note:°dONLNdYëãùƒ)B When the foreign file system’s HFSCIProc is later called with the°dONLNdúùl©˚(¶lRVolumeMount request, the foreign file system cannot call any system routines which°dONLNdÔ©lµˆ* Rmight cause a File Manager request because the File Manager is single-threaded and°dONLNdBµl¡´* not reentrant.°dONLNdQ€lÁ®*& Result codes°dONLNd^ÁÛö+ noErr°dONLNddÁÛ)è0°dONLNdfÁ3Û˘)%'The VolumeMount request belongs to this°dONLNdëÛ3ˇã* foreign file system°dONLNd•ˇ ™(extFSErr°dONLNdÆˇ )Ö-58°dONLNd≤ˇ3  )/*The VolumeMount request does not belong to°dONLNd‡ 3ü* this foreign file system,     Helvetica
  3238. °dONLNd˘3`B‚(>`ffsInformMessage°dONLNd    3‚B˚)Ç (6)
  3239. °dONLNdM`Y¸(V`SThis message is passed to the file system communications function when InformFFS is°dONLNdbY`e* Vcalled. The paramBlock parameter is the same paramBlock parameter passed to InformFFS.°dONLNdπq`}*TThe ffsInformMessage allows other programs to pass your foreign file system messages°dONLNd}`â´* defined by you.°dONLNdùl©®+   Result codes°dONLNd+©µö+ noErr°dONLNd1©µ)è0°dONLNd3©3µ\)%No error°dONLNd<µ¡æ(æEany result codes defined by your foreign file system for this request(Ò5$File System Manager Service Routines)–1-)
  3240. 25ˇËdˇ ˇˇˇˇd
  3241. d,     Helvetica
  3242. .°dONLNdV`hk+`d2°dONLNdVÑhŒ)$THE HFS COMPONENT INTERFACE Q^Q h^h,Times
  3243. (Ú 2-)
  3244. 1ˇ vdˇ ˇˇˇˇd
  3245. d,Times
  3246. .+H3 Guide to the File System Manager,     Helvetica
  3247. °dONLNdUHdÚ*-ABOUT THIS CHAPTER NFN gFg
  3248. °dONLNd~HäÌ*'WThis chapter describes the HFS component interface, the data structures used by the HFS°dONLNdkäHñÂ* Vcomponent interface, and the routines your foreign file system must provide to the HFS°dONLNd¬ñH¢´* component interface.°dONLNd◊ÆH∫Î*ZTo use this chapter, you should be familiar with the information in the chapters “The File°dONLNd2∫HΔÔ* WSystem Manager” and “File System Utility Routines” in this document, the information in°dONLNdäΔH“∂* Inside Macintosh: Files°dONLNd°Δ∂“()n, and the information in °dONLNd∫Δ(“§)rInside Macintosh: Devices°dONLNd”Δ§“®)|.
  3249. °dONLNd’˜Há(H!ABOUT THE HFS COMPONENT INTERFACE F     F    
  3250. °dONLNd˜ H,˘*'YThe HFS component interface allows a foreign file system to process File Manager requests°dONLNdQ,H8Ÿ* Xand allows a foreign file system to describe its file system services to the File System°dONLNd™8HD˜* YManager. Whenever a File Manager request is made to a volume controlled by a foreign file°dONLNdDHP¸* ]system, the File System Manager will pass that request to the foreign file system through the°dONLNdbPH\≈* HFS component interface.
  3251. °dONLNd{ÅHêÉ*3!USING THE HFS COMPONENT INTERFACE zFz ìFì
  3252. °dONLNdù™H∂∞*'This section describes°dONLNd¥¬TŒX+ •°dONLNd∂¬aŒ)
  3253. "the HFS Component Interface record°dONLNdŸ⁄TÊX(„T•°dONLNd€⁄aÊÓ)
  3254. the foreign file system’s stack°dONLNd˚ÚT˛X(˚T•°dONLNd˝Úa˛t)
  3255. 7the HFS Component Interface request processing function°dONLNd5
  3256. TX(T•°dONLNd7
  3257. aˆ)
  3258.  the Logical to Physical function°dONLNdX"T.X(+T•°dONLNdZ"a.“)
  3259. the Extend File function
  3260. °dONLNdsFHU[(QH"The HFS Component Interface Record UFU
  3261. °dONLNdñbHnˇ*\The HFS component interface record in an File System Descriptor lets the foreign file system°dONLNdÛnHzÂ* Ytell the HFS component interface how to dispatch file system requests to the foreign file°dONLNdMzHÜ* ^system. It tells the HFS component interface where the routines to handle file system requests°dONLNd¨ÜHíÚ* Zare in memory, what disk block the foreign file system needs to identify a disk, and where°dONLNdíHûÂ* Tthe foreign file system’s stack is. The data type HFSCIRec defines the HFS component°dONLNd\ûH™ï* interface record.*K2-)
  3262. 2)&!Using the HFS component interfaceˇŒdˇ ˇˇˇˇd
  3263. d,Times
  3264. .(3âThe HFS Component Interface,
  3265. Courier
  3266. °dONLNdilu“(rlstruct HFSCIRec {°dONLNduäÅ¢+ long°dONLNdu˘ÅS)ocompInterfMask;°dONLNd'uiÅÁ)p/* component flags */°dONLNd=Åäç∫(ääHFSCIUPP°dONLNdFÅ˘çS)ocompInterfProc;°dONLNdVÅiçˇ)p/* pointer to file system°dONLNduç{ô+ request processing code */°dONLNdêôä•Δ(¢ä
  3267. Lg2PhysUPP°dONLNdõô˘•A)o log2PhyProc;°dONLNd®ôi•)p/* pointer to Lg2PhysProc */°dONLNd≈•ä±ú(ÆäPtr°dONLNd…•˘±/)o    stackTop;°dONLNd”•i± )p/* file system stack top */°dONLNdÔ±äΩ¢(∫älong°dONLNdÙ±˘Ω5)o
  3268. stackSize;°dONLNdˇ±iΩ·)p/* file system stack°dONLNdΩ{…•+ size */°dONLNd!…ä’ú(“äPtr°dONLNd%…˘’/)o    stackPtr;°dONLNd/…i’Ì)p/* current file system°dONLNdK’{·€+ stack pointer */°dONLNd\·äÌ¢(Íälong°dONLNda·˘Ì5)o
  3269. reserved3;°dONLNdl·iÌÌ)p/* --reserved, must be°dONLNdàÌ{˘±+     zero-- */°dONLNdí˘ä¢(älong°dONLNdó˘˘/)o    idSector;°dONLNd°˘i)p/* Sector you need to ID a°dONLNd¡{·+ local volume. For°dONLNdÿ{* networked volumes, this°dONLNdı{)€* should be -1. */°dONLNd)ä5¢(2älong°dONLNd )˘55)o
  3270. reserved2;°dONLNd)i5Ì)p/* --reserved, must be°dONLNd25{A±+     zero-- */°dONLNd<AäM¢(Jälong°dONLNdAA˘M5)o
  3271. reserved1;°dONLNdLAiMÌ)p/* --reserved, must be°dONLNdhM{Y±+     zero-- */°dONLNdrYäeñ(bä};°dONLNdueäqP* !typedef struct HFSCIRec HFSCIRec;°dONLNdóqä}>* typedef HFSCIRec *HFSCIRecPtr;
  3272. °dONLNd∂é`öΔ(ó`Field descriptions°dONLNd…®`¥Æ*compInterfMask°dONLNdÿ®Ã¥)lAContains the HFS component interface dispatch mask. Currently the°dONLNd¥Ã¿H* following bits are defined:°dONLNd6¿ÃÛ* Bit°dONLNd;¿eÃï)ôMeaning°dONLNdCÃÃÿ‚(’Ã0-17°dONLNdIÃeÿï)ô    Reserved.°dONLNdSÿÉÿ(·Ã18°dONLNdVÿÁ‰J)hfsCIHLL2PProcBit°dONLNdhÿe‰˛)~"Set this bit if the log2PhyProc is°dONLNdé‰e* &written in a high level language using°dONLNd∏e¸* &Pascal calling conventions. Note: this°dONLNd‚¸e
  3273. * #bit should always be set by foreign°dONLNd    e˘* !file systems using the logical to°dONLNd.e * $physical interface described in this°dONLNdV e,ã* chapter.°dONLNd_,Ã8ÿ(5Ã19°dONLNdb,Á8_)hfsCIResourceLoadedBit°dONLNdy,e8)~"Set this bit if the HFSCIProc code°dONLNdü8eDˇ* "resource is loaded. If the foreign°dONLNd≈DeP* #file system doesn’t support dynamic°dONLNdÏPe\* "loading, this bit should always be°dONLNd\ehv* set.°dONLNdhÃtÿ(qÃ20°dONLNdhÁt^)hfsDoesDynamicLoadBit°dONLNd0het)~#Set this bit if dynamically loading°dONLNdWteÄÁ* code resource is supported.°dONLNdsÄÃåÿ(âÃ21°dONLNdvÄÁåS)hfsCIDoesDeskTopBit°dONLNdäÄeå˜)~Set this bit if Desktop Manager°dONLNd≠åeò* %requests are supported. Obsolete, but°dONLNd÷òe§* "should be set. Current versions of°dONLNd¸§e∞* FSM always pass Desktop Manager°dONLNd∞eº * $requests on to foreign file systems.(ÚB!Using the HFS component interface)…2-)
  3274. 3ˇ¥dˇ ˇˇˇˇd
  3275. d,Times
  3276. .+H3 Guide to the File System Manager°dONLNdU¥a¿+l+22°dONLNdUœaG)hfsCIDoesAppleShareBit°dONLNdUMa˛)~'Set this bit if AppleShare requests are°dONLNdEaMmÂ* supported. Obsolete, but should°dONLNdhmMyÊ* be set. Current versions of FSM°dONLNdãyMÖ˘* "always pass AppleShare requests on°dONLNd±ÖMë∫* to foreign file systems.°dONLNd ë¥ù¿(ö¥23°dONLNdÕëœù')hfsCIDoesHFSBit°dONLNd›ëMùfi)~ Set this bit if HFS requests are°dONLNdùM©Â* supported. Obsolete, but should°dONLNd$©MµÊ* be set. Current versions of FSM°dONLNdGµM¡Â* always pass HFS requests on to°dONLNdi¡MÕÆ* foreign file systems.°dONLNdÕ¥Ÿ–(÷¥24-29°dONLNdÖÕMŸ÷)ôReserved for the File System°dONLNd•ŸMÂñ* Manager’s use.°dONLNd¥Â¥Ò¿(Ó¥30°dONLNd∑œÒ?)fsmComponentBusyBit°dONLNdÀÂMÒ˜)~#If set, the FSM component interface°dONLNdÚÒM˝* 'is busy (i.e., one or more requests are°dONLNd˝M    Ù* $outstanding). This bit is maintained°dONLNdE    MÓ*  by the component and used by the°dONLNdiM!Ú* "File System Manager to control the°dONLNdè!M-Í*  use of the SetFSInfo File System°dONLNd≥-M9¬* Manager service routine.°dONLNdÃ9¥E¿(B¥31°dONLNdœ9œEF)fsmComponentEnableBit°dONLNdÂ9MEÂ)~If set, the component may begin°dONLNdEMQ* (dispatching requests to the foreign file°dONLNd4QM]‚* system. The foreign file system°dONLNdW]Mi…* should set this bit with the°dONLNdwiMuÂ* SetFSInfo File System Manager°dONLNdòuMÅÎ* $service routine once it  is ready to°dONLNd¿ÅMçú* receive requests.°dONLNd“ïH°í(ûHcompInterfProc°dONLNd·ï∏°‡)p=Contains a pointer to the foreign file system’s HFS component°dONLNd°∏≠l* 'interface request processing function .°dONLNdGµH¡Ü(æH log2PhyProc°dONLNdSµ∏¡Ï)pCContains a pointer to the foreign file system’s Logical to Physical°dONLNdó¡∏Õ›* routine.°dONLNd†’H·s(fiHstackTop°dONLNd©’∏·„)pBContains a pointer to the top of the foreign file systems’s stack.°dONLNdÏ·∏̉* >stackTop must be word aligned value since it becomes the stack°dONLNd+Ì∏˘®* 4pointer whenever the foreign file systems is called.°dONLNd`H
  3277. t(
  3278. H    stackSize°dONLNdj∏
  3279. Æ)p6Contains the size of the foreign file systems’s stack.°dONLNd°H!n(HstackPtr°dONLNd™∏!≤)p3Reserved for future use by the File System Manager.°dONLNdfi)H5v(2H    reserved3°dONLNdË)∏5B)pReserved, must contain zero.°dONLNd=HIo(FHidSector°dONLNd=∏I)pEContains the sector the foreign file system needs to identify a local°dONLNdTI∏U* Fvolume, or contains -1 if a network foreign file system. When the file°dONLNdõU∏aÔ* >system communications function is called with ffsIDDiskMessage°dONLNd⁄a∏mÛ* Cand idSector is not -1, the paramBlock parameter points to the disk°dONLNdm∏yÓ* @block specified. When the file system communications function is°dONLNd_y∏ÖÌ* ?called with ffsIDDiskMessage and idSector is -1, the paramBlock°dONLNdüÖ∏ëˆ* Aparameter points to the parameter block used to make the MountVol°dONLNd·ë∏ù˝* Drequest and the ioVRefNum field in that parameter block contains the°dONLNd&ù∏©l* $drive number of the volume to mount.°dONLNdK±HΩv(∫H    reserved2°dONLNdU±∏ΩB)pReserved, must contain zero.°dONLNdr≈H—v(ŒH    reserved1°dONLNd|≈∏—B)pReserved, must contain zero.(ÚH2-)
  3280. 4)&!Using the HFS component interfaceˇ6dˇ ˇˇˇˇd
  3281. d,Times
  3282. .(3âThe HFS Component Interface,     Helvetica
  3283. °dONLNdU`dH(``The Foreign File System’s Stack d^d
  3284. °dONLNd q`}*YEach foreign file system must have its own alternate stack. The File System Manager’s HFS°dONLNdz}`â˘* Ycomponent interface saves the original application stack and switches to the foreign file°dONLNd‘â`ï* ^system’s alternate stack before calling the foreign file system’s request processing function.°dONLNd3ï`°
  3285. * ZAfter the foreign file system services the File Manager request, The File System Manager’s°dONLNdé°`≠∑* HHFS component interface switches back to the original application stack.°dONLNd◊π`≈ *\If the foreign file system performs I/O through the File System Utility cached I/O routines,°dONLNd4≈`—
  3286. * [there will be an additional stack switch while the HFS file system handles the I/O. Foreign°dONLNdê—`›œ* Pfile system Logical to Physical routines run on the foreign file system’s stack.°dONLNd·È`ı·*SThe foreign file system’s alternate stack must be allocated in the system heap with°dONLNd5ı`˜* UNewPtrSys before the HFS component interface is activated. If the foreign file system°dONLNdã`
  3287. * \supports dynamically loading code resources, the stack can be allocated when the file system°dONLNdË
  3288. `˜* Tcommunications function is called with the ffsLoadMessage and released when the file°dONLNd=`%≠* Csystem communications function is called with the ffsUnloadMessage.°dONLNdÅ1`=˘*WThe size of a foreign file system’s alternate stack should be the amount needed by your°dONLNdŸ=`I* _foreign file system plus two or three kilobytes of additional space for use by interrupt driven°dONLNd9I`Uß* Cprocesses which may borrow space at interrupt time from your stack.
  3289. °dONLNd}m`|*&7The HFS Component Interface Request Processing Function |^|
  3290. °dONLNdµâ`ï*YThe HFS Component Interface request processing function pointed to by compInterfProc in a°dONLNdï`°* VHFSCIRec is called by the File System Manager to handle File Manager requests. The HFS°dONLNdf°`≠€* MComponent Interface request processing function must have the following form.,
  3291. Courier
  3292. °dONLNd¥∫`Δ™*7pascal OSErr HFSCIProc(VCBPtr theVCB, short selectCode,°dONLNdÛΔ˜“]+ó void *paramBlock,
  3293. °dONLNdΔ]“`)f 
  3294. °dONLNdΔ`““)void *fsdGlobalPtr,°dONLNd “˜fi?(€˜ short fsid);
  3295. °dONLNd-È`ıÜ(Ú`theVCB°dONLNd4ÈÃı    )lEContains a pointer to the VCB of the volume that is the target of the°dONLNdzıÃ(* file system request.°dONLNdè    `ì(`
  3296. selectCode°dONLNdö    Ã¯)l=Contains either the A-Trap number or the HFSDispatch selector°dONLNdÿÃ!Á* 9number which indicates what file system request was made.°dONLNd)`5ô(2`
  3297. paramBlock°dONLNd)Ã5)lCContains a pointer to the parameter block passed to the file system°dONLNda5ÃAÚ* request.°dONLNdjI`Uù(R` fsdGlobalPtr°dONLNdwIÃU)lDContains a pointer to the foreign file system’s optional global data°dONLNdºUÃa„* area.°dONLNd¬i`ur(r`fsid°dONLNd«iÃuª)l1Contains the file system ID number of the volume.+vÄ!Using the HFS component interface)…2-)
  3298. 5ˇ&dˇ ˇˇˇˇd
  3299. d,Times
  3300. .+H3 Guide to the File System Manager°dONLNdUHaı*+YWhen a foreign file system’s HFSCIProc is called, it is told which volume (theVCB) is the°dONLNdZaHmˇ* \target of the file system request (except for MountVol and VolumeMount as explained later in°dONLNd∑mHyˆ* [this section), what file system request was made, and is passed the parameter block used to°dONLNdyHÖÌ* \make the file system request. The foreign file system should handle the request, fill in the°dONLNdpÖHëˆ* ]appropriate fields in the parameter block, and return the appropriate result. The File System°dONLNdŒëHùı* \Manager provides File System Utility routines to your foreign file system to help it process°dONLNd+ùH©§* file system request.,
  3301.  
  3302. Zapf Dingbats
  3303. °dONLNd@µT¡_+ s°dONLNdB∂f¬ö)Warning:°dONLNdJ∂ö¬‚)4F  When the foreign file system’s HFSCIProc is called, the foreign file°dONLNdë¬fŒÀ(ÀfHsystem cannot do anything which might cause another File Manager request°dONLNd⁄Œf⁄›* Qbecause the File Manager is single-threaded and is not reentrant. If your foreign°dONLNd,⁄fÊÈ* Nfile system’s HFSCIProc does cause another File Manager request, the Macintosh°dONLNd{ÊfÚ–* system will deadlock. 
  3304.     °dONLNdëË–Òÿ)js
  3305. °dONLNdìH¯(
  3306. H\The HFSCIProc is also passed a pointer to the foreign file system’s global data area and the°dONLNdHˇ* [file system ID number of the volume. The file system ID number allows a foreign file system°dONLNdLH(˙* ]that handles multiple file systems to quickly determine which file system needs to handle the°dONLNd™(H4§* file system request.°dONLNdøHTTê+   Result codes°dONLNdÃTg`Ç+ noErr°dONLNd“Tˆ`¸)è0°dONLNd‘T`ı)%-The foreign file system handled the Macintosh°dONLNd`lπ* "file system request with no errors°dONLNd(lgx(ugTany of the result codes documented for a particular Macintosh file system request in°dONLNd}xgÑ’* Inside Macintosh: Files°dONLNdïöH¶¸(£H[Listing 2-1 is an abbreviated example of a request processing function. Not all HFSDispatch°dONLNdÒ¶H≤õ* Fselectors and Macintosh file system A-Traps are shown in this example.°dONLNd8æ| ¿+4 Listing 2-1.°dONLNdDæ¿ Œ)D5  HFS Component Interface request processing function,
  3307. Courier
  3308. °dONLNdz”Hflí(‹H7/* Prototype for file system request handler routine */°dONLNd≤flHÎ∞* <typedef OSErr (*hfsProcPtr)(VCBPtr theVCB, short selectCode,°dONLNd˙θ˜⁄+¥ %void *paramBlock, void *fsdGlobalPtr,°dONLNd+˜¸D* short fsid);°dONLNd9Hê(H pascal OSErr°dONLNdF¢§)Z+HFSCIProc (VCBPtr theVCB, short selectCode,°dONLNd|Í'»+H %void *paramBlock, void *fsdGlobalPtr,°dONLNd¨'Í3,* short fsid)°dONLNd∏3H?N(<H{°dONLNdª?ZKx+ OSErr°dONLNd√?¢K)Hresult = extFSErr;°dONLNd◊KZWñ(TZ
  3309. hfsProcPtr°dONLNd„K¥W‰)ZhfsProc;°dONLNdÌWZcÆ(`Zunsigned short°dONLNd¸W¥cÍ)Z    trapWord;°dONLNd    oZ{‘(xZ?/* selectCode contains the trap word or HFSDispatch selector */°dONLNdJ{Zá⁄* @/* Clear the trap attributes (i.e., async and immediate bits) */°dONLNdåáZì* trapWord = selectCode & 0xF0FF;°dONLNdØüZ´¯*E/* and find out what to call with the big, big switch statement... */°dONLNdˆ´Z∑¿* switch (trapWord)°dONLNd        ∑Z√`* {
  3310. (ÚH2-)
  3311. 6)&!Using the HFS component interfaceˇ    >dˇ ˇˇˇˇd
  3312. d,Times
  3313. .(3âThe HFS Component Interface,
  3314. Courier
  3315. °dONLNdUÑaò(^Ñ./* HFSDispatch (A260) file system selectors */°dONLNd1aÑm‰* case kFSMOpenWD:°dONLNdEmñy+ hfsProc = DoOpenWD;°dONLNd\yñÖ∫* break;°dONLNdeÖÑëê(éÑ/*°dONLNdjëÑù* @** The rest of HFSDispatch (A260) file system selectors go here.°dONLNd≠ùÑ©ê* */°dONLNd≤©Ñµ¸* case kFSMMakeFSSpec:°dONLNd µñ¡ + hfsProc = DoMakeFSSpec;°dONLNd¡ñÕ∫* break;°dONLNdÒŸÑÂ∞(‚Ñ2/* HFSDispatch (A260) Desktop Manager selectors */°dONLNd&ÂÑÒˆ* case kFSMDTGetPath:°dONLNd=Òñ˝+ hfsProc = DoDTGetPath;°dONLNdW˝ñ    ∫* break;°dONLNd`    Ñê(Ñ/*°dONLNdeÑ!Ê* ;** The rest of HFSDispatch (A260) Desktop Manager selectors°dONLNd§!Ñ-Δ* ** go here.°dONLNd≤-Ñ9ê* */°dONLNd∑9ÑE* case kFSMDTDelete:°dONLNdÕEñQ+ hfsProc = DoDTDelete;°dONLNdÊQñ]∫* break;°dONLNdÚiÑuí(rÑ-/* HFSDispatch (A260) AppleShare selectors */°dONLNd"uÑÅ* case kFSMGetVolParms:°dONLNd;Åñç&+ hfsProc = DoGetVolParms;°dONLNdWçñô∫* break;°dONLNd`ôÑ•ê(¢Ñ/*°dONLNde•ѱ»* 6** The rest of HFSDispatch (A260) AppleShare selectors°dONLNdü±ÑΩΔ* ** go here.°dONLNd≠ΩÑ…ê* */°dONLNd≤…Ñ’* case kFSMSetForeignPrivs:°dONLNdœ’ñ·>+ hfsProc = DoSetForeignPrivs;°dONLNdÔ·ñÌ∫* break;°dONLNd˚˘Ñ(Ñ/* File system A-traps */°dONLNdÑÿ* case kFSMOpen:°dONLNd)ñ¸+ hfsProc = DoOpen;°dONLNd>ñ)∫* break;°dONLNdG)Ñ5ê(2Ñ/*°dONLNdL5ÑAÜ* +** The rest of File system A-traps go here.°dONLNdzAÑMê* */°dONLNdMÑYˆ* case kFSMFlushFile:°dONLNdñYñe+ hfsProc = DoFlushFile;°dONLNd∞eñq∫* break;°dONLNdº}Ñâ>(ÜÑ/* and if it wasn't there... */°dONLNdfiâÑï¥* default:°dONLNdÍïñ°V+  hfsProc = DoRequestNotSupported;°dONLNd°ñ≠∫* break;°dONLNd≠rπx(∂r}
  3316. +–<!Using the HFS component interface)…2-)
  3317. 7ˇädˇ ˇˇˇˇd
  3318. d,Times
  3319. .+H3 Guide to the File System Manager,
  3320. Courier
  3321. °dONLNdUZaŒ++>/* Call the appropriate file system request handler routine */°dONLNd@aZm¯* Eresult = hfsProc(theVCB, selectCode, paramBlock, fsdGlobalPtr, fsid);°dONLNdámZy¥* return(result);°dONLNdóyHÖN(ÇH},     Helvetica
  3322. °dONLNdôûH≠ô*'*Handling MountVol and VolumeMount requests
  3323. °dONLNdƒ∏Hƒˆ*YThere are two File Manager requests sent to a foreign file system’s HFSCIProc that may or°dONLNdƒH–fi* Qmay not be handled by your foreign file system, MountVol (selectCode = $A00F) and°dONLNdp–H‹˝* VVolumeMount (selectCode = $0041). The File System Manager sends those requests to each°dONLNd«‹H˯* ainstalled foreign file system until one of the foreign file systems indicates that it has handled°dONLNd)ËHÙ* the request.°dONLNd6H ˝*]If your foreign file system receives a MountVol request, it must determine if the disk volume°dONLNdî H˜* [belongs to it. You may be able to use the same code your foreign file system used to handle°dONLNdH$˝* [the ffsIDDiskMessage is passed to the file system communications function. If the volume is°dONLNdL$H0¯* Xnot your volume, you must return extFSErr. If the volume is your volume, you must return°dONLNd•0H<‹* WnoErr if you successfully mount the volume, or one of the error result codes listed for°dONLNd˝<HH* &PBMountVol in Inside Macintosh: Files.°dONLNd$TH`˘*WIf your foreign file system receives a VolumeMount request and supports the VolumeMount°dONLNd|`HlÚ* Trelated selectors (VolumeMount, GetVolMountInfoSize, and GetVolMountInfo), it should°dONLNd—lHx˙* Xcompare the media field in the VolumeMountInfoHeader to your foreign file system’s media°dONLNd*xHÑÙ* \type. If the media field does not match your media type, return extFSErr. If the media field°dONLNdáÑHêÚ* Wmatches your media type, you must return noErr if you successfully mount the volume, or°dONLNdflêHúÙ* Zone of the error result codes listed for PBVolumeMount in Inside Macintosh: Files. If your°dONLNd:úH®Á* Xforeign file system does not support the VolumeMount related selectors, it should return°dONLNdì®H¥x*     paramErr.
  3324. °dONLNdùÃH€û*&.The Logical to Physical Block Mapping Function €F€
  3325. °dONLNdÃËHÙˇ*\The Macintosh cache routines described in “File System Utility Routines” chapter can read or°dONLNd)ÙHÚ* [write either logical blocks of a file or physical blocks of a volume. However, because disk°dONLNdÖH * ^driver device requests always read or write physical blocks of a volume, a foreign file system°dONLNd‰ HÙ* \must provide a routine to map logical file blocks to physical volume blocks. That routine is°dONLNdAH$¯* `called the logical to physical routine. The address of the logical to physical routine is passed°dONLNd¢$H0˘* Yto the File System Manager in the log2PhyProc field of the foreign file system’s HFSCIRec°dONLNd¸0H<Ê* Xand as a parameter to some cache routines. The logical to physical routine must have the°dONLNd    U<HHî* following form.
  3326. °dONLNd    eUHaP*,pascal OSErr Lg2PhysProc(void *fsdGlobalPtr,°dONLNd    òaflmi+ó VCBPtr volCtrlBlockPtr,°dONLNd    ∂mflyÅ* FCBRecPtr fileCtrlBlockPtr,°dONLNd    ÿyflÖE* short fileRefNum,°dONLNd    ÖflëÅ* unsigned long filePosition,°dONLNd
  3327. ëflùi* unsigned long reqCount,°dONLNd
  3328. 0ùfl©u* unsigned long *volOffset,°dONLNd
  3329. P©flµü*  unsigned long *contiguousBytes);
  3330. (ÚH2-)
  3331. 8)&!Using the HFS component interfaceˇ<dˇ ˇˇˇˇd
  3332. d,Times
  3333. .(3âThe HFS Component Interface°dONLNdU`aù(^` fsdGlobalPtr°dONLNd
  3334. UÃa)lDContains a pointer to the foreign file system’s optional global data°dONLNdRaÃm„* area.°dONLNdXu`Å´(~`volCtrlBlockPtr°dONLNdhuÃÅÔ)l<Contains a pointer to the file’s Volume Control Block (VCB).°dONLNd•â`ï´(í`fileCtrlBlockPtr°dONLNd∂âÃï)lHContains a pointer to the file’s File Control Block (FCBRec) that is the°dONLNdˇïðå* *target of the logical to physical mapping.°dONLNd*©`µò(≤`
  3335. fileRefNum°dONLNd5©Ãµ{)l%Contains the file’s reference number.°dONLNd[Ω`…ñ(Δ` filePosition°dONLNdhΩÃ…)lFContains the byte offset into the file’s data where the mapping should°dONLNdØ…Ã’Ö* 'begin (always a multiple of 512 bytes).°dONLNd◊›`Èå(Ê`reqCount°dONLNd‡›ÃÈ)l@Contains the number of bytes requested for the mapping operating°dONLNd!ÈÃıh* !(always a multiple of 512 bytes).°dONLNdC˝`    å(`    volOffset°dONLNdM˝Ã    )lEContains a pointer to an unsigned long. Lg2PhysProc places the offset°dONLNdì    Ã* H(in bytes) to the volume block where the file data can be found into the°dONLNd‹Ã!¯* Afield referred to by this parameter. The value returned must be a°dONLNd!Ã-4* multiple of 512 bytes.°dONLNd55`AØ(>`contiguousBytes°dONLNdE5ÃA˚)l>Contains a pointer to an unsigned long. Lg2PhysProc places the°dONLNdÑAÃM* Dnumber of contiguous bytes which occur after the given offset, up to°dONLNd…MÃY
  3336. * ErequestCount, into the field referred to by this parameter. The value°dONLNdYÃeé* )returned must be a multiple of 512 bytes.°dONLNd9w`É(Ä`bIt is the responsibility of the foreign file system to return an eofErr when a request for data is°dONLNdúÉ`è˙* ]beyond the current logical end of file (before calling the Cache utility routines). It is the°dONLNd˙è`õ* `responsibility of the logical to physical routine to return an eofErr error when a cache routine°dONLNd[õ`ßã* ?asks for block mapping beyond the current physical end of file.°dONLNdõªl«®+   Result codes°dONLNd®«”ö+ noErr°dONLNdÆ«”)è0°dONLNd∞«3”)%*Logical to physical mapping was successful°dONLNd€”flù(‹eofErr°dONLNd‚”fl)Ö-39°dONLNdÊ”3fl›)/ Requested mapping was beyond the°dONLNd
  3337. fl3Îç* physical end of file°dONLNdΘó(ÙioErr°dONLNd%Θ)Ö-36°dONLNd)Î3˜)/-Mapping failed because of an unexpected error°dONLNdW
  3338. `
  3339. (`[Here is a brief description of how logical to physical mapping works. Assume that a file is°dONLNd≥`%* [open and that file occupies the physical blocks 101 through 103 and 105 through 109 (8 disk°dONLNd%`1* Xblocks) on the disk volume. The logical to physical routine needs to map bytes 0 through°dONLNdh1`=* T1535 to blocks 101 through 103 and map bytes 1536 through 8191 to blocks 105 through°dONLNdΩ=`IÙ* T109. Here’s an example of how a logical to physical routine would perform the job of°dONLNdI`U* &mapping a read to the fragmented file.°dONLNd9a`m*[A Read request is recieved through the HFSCIProc asking for 3072 bytes starting at offset 0°dONLNdïm`y* Tin the file. The HFSCIProc calls the file system’s Read request hander routine which°dONLNdÍy`Ö»* Meventually calls UTCacheReadIP to read the data from the file. The first time°dONLNd    8Ö`ë* UUTCacheReadIP is called, the Macintosh cache mechanism calls your logical to physical°dONLNd    éë`ù* Zroutine with filePosition = 0 and reqCount = 3072. The logical to physical routine returns°dONLNd    Èù`©* Y51712 in volOffset (the byte offset of block 101) and 1536 in contiguousBytes (the number°dONLNd
  3340. C©`µ* \of contiguous bytes starting at offset 51712 ). The Macintosh cache mechanism will then read°dONLNd
  3341. †µ`¡–* L1536 bytes starting at offset 51200 into the buffer passed to UTCacheReadIP.+‚4!Using the HFS component interface)…2-)
  3342. 9ˇ"dˇ ˇˇˇˇd
  3343. d,Times
  3344. .+H3 Guide to the File System Manager°dONLNdUHaÒ*+[Since the Read request hasn’t been satisfied, the file system’s Read request hander routine°dONLNd\aHm¯* Zupdates the buffer pointer and calls UTCacheReadIP again - this time asking for 1536 bytes°dONLNd∑mHyfl* Xstarting at offset 1536 in the file. The Macintosh cache mechanism calls your logical to°dONLNdyHÖ‚* Vphysical routine with filePosition = 1536 and reqCount = 1536. The logical to physical°dONLNdgÖHë±* Mroutine returns 53760 in volOffset (the byte offset of block 105) and 1536 in°dONLNdµëHù˜* YcontiguousBytes (the number of contiguous bytes starting at offset 53760 ). The Macintosh°dONLNdùH©˘* \cache mechanism will then read 1536 bytes starting at offset 53760 into the buffer passed to°dONLNdl©Hµ9* /UTCacheReadIP and the Read request is complete.(ÚH2-)
  3345. 10)&!Using the HFS component interfaceˇÏdˇ ˇˇˇˇd
  3346. d,     Helvetica
  3347. .°dONLNdV`hk+`d3°dONLNdVÑhË)$ THE FILE SYSTEM UTILITY ROUTINES Q^Q h^h,Times
  3348. (Ú
  3349. 3-)
  3350. 1ˇ zdˇ ˇˇˇˇd
  3351. d,Times
  3352. .+H3 Guide to the File System Manager,     Helvetica
  3353. °dONLNdUHdÚ*-ABOUT THIS CHAPTER NFN gFg
  3354. °dONLNd~Hä‚*'WThis chapter describes the utility routines provided by the File System Manager to your°dONLNdkäHñfl* Yforeign file system to help it process Macintosh file system calls and describes the data°dONLNd≈ñH¢* -structures used by the Macintosh file system.°dONLNdÛÆH∫Î*XTo use this chapter, you should be familiar with the information in the chapter “The HFS°dONLNdL∫HΔ_* :Component Interface” in this document, the information in °dONLNdÜ∫_ΔÕ(√_Inside Macintosh: Files°dONLNdù∫ÕΔˆ)n    , and the°dONLNdßΔH“é(œHinformation in °dONLNd∂Δé“
  3355. )FInside Macintosh: Devices°dONLNdœΔ
  3356. “)|.
  3357. °dONLNd—˜Hz(H"ABOUT FILE SYSTEM UTILITY ROUTINES F     F    
  3358. °dONLNdı H,*'[The File System Utility routines are intended for use by foreign file systems to allow your°dONLNdQ,H8¨* foreign file system to°dONLNdhDTPX+ •°dONLNdjDaPÚ)
  3359. Raccess file control blocks (FCBs), volume control blocks (VCBs), working directory°dONLNdΩPa\Ñ* 9control blocks (WDCBs), and drive queue elements (DrvQEl)°dONLNd˜hTtX(qT•°dONLNd˘hatY)
  3360. 4set and get the default volume and working directory°dONLNd.ÄTåX(âT•°dONLNd0Äaå§)
  3361. eject a volume°dONLNd?òT§X(°T•°dONLNdAòa§≥)
  3362. Gvalidate and process parameters passed with Macintosh file system calls°dONLNdâ∞TºX(πT•°dONLNdã∞aº√)
  3363. Kaccess the Macintosh file system’s cache buffers and low-level I/O services,
  3364.  
  3365. Zapf Dingbats
  3366. °dONLNd◊»T‘_(“Ts°dONLNdŸ…f’ö)Warning:°dONLNd·…ö’Â)4G  File System Utility routines that can cause I/O through the Macintosh°dONLNd)’f·≠(fif>file system’s cache, UTGetBlock, UTReleaseBlock, UTFlushCache,°dONLNdh·fÌÍ* LUTCacheReadIP, and UTCacheWriteIP, must be called from a foreign file system°dONLNdµÌf˘Ë* Qhandling a request through its HFSCIProc. Attempts to call those routines outside°dONLNd˘fÅ* ;of the context of the HFSCIProc will cause a system crash. 
  3367.     °dONLNdB˚Åâ(Ås
  3368. °dONLNdD0H?®(;H%MACINTOSH FILE SYSTEM DATA STRUCTURES )F) BFB
  3369. °dONLNdjYHefi*'XThis section describes the data structures used internally by the Macintosh file system.°dONLNd√eHqˆ* [Foreign file systems need to access and manipulate these data strutures when handling calls°dONLNdqH}* !from the HFS component interface.°dONLNdAâHïΔ*The data structures include°dONLNd]°T≠X+ •°dONLNd_°a≠Ú)
  3370. volume control blocks (VCBs)°dONLNd|πT≈X(¬T•°dONLNd~πa≈›)
  3371. file control blocks (FCBs)(ÚH3-)
  3372. 2)&%Macintosh File System Data Structuresˇ“dˇ ˇˇˇˇd
  3373. d,Times
  3374. .(3Ä The File System Utility Routines°dONLNdUlap(^l•°dONLNdUyaG)
  3375. (working directory control blocks (WDCBs)°dONLNd+mlyp(vl•°dONLNd-myy )
  3376. drive queue elements (DrvQEl)°dONLNdKÖ`ë(é`]The data structures (except for working directory control blocks) and their use are described°dONLNd©ë`ùl* in °dONLNd¨ëlù⁄) Inside Macintosh: Files°dONLNd√ë⁄ù)nA. The following sections describe how foreign file systems should°dONLNdù`©é(¶`    use them.,     Helvetica
  3377. °dONLNd¡`–*&Volume Control Blocks –^–
  3378. °dONLNd%›`È    *YEach time a volume is mounted, a foreign file system must allocate a volume control block°dONLNdÈ`ı* Z(VCB) with UTAllocateVCB, read the volume and use the information to initialize the fields°dONLNd⁄ı`¸* Lin the new VCB, and add the VCB to the VCB queue with UTAddNewVCB (unless an°dONLNd'`
  3379. * Uejected or offline volume is being remounted). When a volume is unmounted, its VCB is°dONLNd}
  3380. `C* (removed from the VCB queue UTDisposeVCB.°dONLNd¶%`1ˇ*UThe volume control block queue is a standard Operating System queue maintained in the°dONLNd¸1`=* Ysystem heap. It contains a volume control block for each mounted volume. A volume control°dONLNdV=`I* _block is a nonrelocatable block that contains volume-specific information. If your foreign file°dONLNd∂I`U * Ysystem needs to keep additional information beyond that kept in the system VCB structure,°dONLNdU`a* Vyou can allocate additional memory with UTAllocateVCB for your extended VCB structure.°dONLNdga`m€* OThe structure of a system volume control block is defined by the VCB data type.,
  3381. Courier
  3382. °dONLNd∑Çlé¥+ ! struct VCB {°dONLNd≈Ç\éh)/*°dONLNd»Çné¯)volume control block */°dONLNd‡éäö∫(óäQElemPtr°dONLNdÈéö)fqLink;°dONLNdé\öh)l/*°dONLNdÛénö‡)next queue entry */°dONLNdöä¶®(£äshort°dONLNd
  3383. ö¶)fqType;°dONLNdö\¶h)l/*°dONLNdön¶º)
  3384. queue type */°dONLNd%¶ä≤®(Øäshort°dONLNd+¶≤&)f    vcbFlags;°dONLNd5¶\≤h)l/*°dONLNd8¶n≤»)volume flags */°dONLNdH≤äæfi(ªäunsigned short°dONLNdW≤æ2)f vcbSigWord;°dONLNdc≤\æh)l/*°dONLNdf≤næ‡)volume signature */°dONLNdzæä ÿ(«ä
  3385. unsigned long°dONLNdàæ ,)f
  3386. vcbCrDate;°dONLNdìæ\ h)l/*°dONLNdñæn ¯)date and time of volume°dONLNd≥ n÷∞* creation */°dONLNdø÷ä‚ÿ(flä
  3387. unsigned long°dONLNdÕ÷‚&)f    vcbLsMod;°dONLNd◊÷\‚h)l/*°dONLNd⁄÷n‚Ï)date and time of last°dONLNdı‚nÓ∂* modification°dONLNdÓä˙®(˜äshort°dONLNdÓ˙ )fvcbAtrb;°dONLNdÓ\˙h)l/*°dONLNdÓn˙Ê)volume attributes */°dONLNd)˙äfi(äunsigned short°dONLNd8˙&)f    vcbNmFls;°dONLNdB˙\h)l/*°dONLNdE˙n¯)number of files in root°dONLNdbn∂* directory */°dONLNdoä®(äshort°dONLNdu&)f    vcbVBMSt;°dONLNd\h)l/*°dONLNdÇnÏ)first block of volume°dONLNdùn*§*     bitmap */°dONLNdß*ä6®(3äshort°dONLNd≠*68)f vcbAllocPtr;°dONLNd∫*\6h)l/*°dONLNdΩ*n6˛)start of next allocation°dONLNd€6nB§*     search */°dONLNdÂBäNfi(Käunsigned short°dONLNdÙBN8)f vcbNmAlBlks;°dONLNdB\Nh)l/*°dONLNdBnN)number of allocation blocks°dONLNd%NnZ∂* in volume */°dONLNd2Zäfÿ(cä
  3388. unsigned long°dONLNd@Zf8)f vcbAlBlkSiz;°dONLNdMZ\fh)l/*°dONLNdPZnf⁄)size (in bytes) of°dONLNdhfnr‘* allocation blocks°dONLNdzrä~ÿ({ä
  3389. unsigned long°dONLNdàr~,)f
  3390. vcbClpSiz;°dONLNdìr\~h)l/*°dONLNdñrn~Ï)default clump size */°dONLNd¨~ää®(áäshort°dONLNd≤~ä,)f
  3391. vcbAlBlSt;°dONLNdΩ~\äh)l/*°dONLNd¿~nä)first allocation block in°dONLNdflänñ§*     volume */°dONLNdÈñ䢢(üälong°dONLNdÓñ¢2)f vcbNxtCNID;°dONLNd˙ñ\¢h)l/*°dONLNd˝ñn¢˛)next unused catalog node°dONLNd¢nÆå* ID */°dONLNd!Æä∫fi(∑äunsigned short°dONLNd0Æ∫2)f vcbFreeBks;°dONLNd<Æ\∫h)l/*°dONLNd?Æn∫)number of unused allocation°dONLNd`∫nΔ§*     blocks */°dONLNdjΔä“®(œäStr27°dONLNdpΔ“)fvcbVN;°dONLNdwΔ\“h)l/*°dONLNdzΔn“¬)volume name */
  3392. (Ú5%Macintosh File System Data Structures)÷3-)
  3393. 3ˇFdˇ ˇˇˇˇd
  3394. d,Times
  3395. .+H3 Guide to the File System Manager,
  3396. Courier
  3397. °dONLNdUraê+*+short°dONLNdUÿa)f
  3398. vcbDrvNum;°dONLNdUDaP)l/*°dONLNdUVa∞)drive number */°dONLNd$armê(jrshort°dONLNd*aÿm)f vcbDRefNum;°dONLNd6aDmP)l/*°dONLNd9aVmÚ)driver reference number */°dONLNdTmryê(vrshort°dONLNdZmÿy)fvcbFSID;°dONLNdcmDyP)l/*°dONLNdfmVyÏ)file-system identifier */°dONLNdÄyrÖê(Çrshort°dONLNdÜyÿÖ)f vcbVRefNum;°dONLNdíyDÖP)l/*°dONLNdïyVÖÚ)volume reference number */°dONLNd∞ÖrëÑ(érPtr°dONLNd¥Öÿë)fvcbMAdr;°dONLNdΩÖDëP)l/*°dONLNd¿ÖVë¬)used internally */°dONLNd”ërùÑ(örPtr°dONLNd◊ëÿù)f
  3399. vcbBufAdr;°dONLNd‚ëDùP)l/*°dONLNdÂëVù¬)used internally */°dONLNd¯ùr©ê(¶rshort°dONLNd˛ùÿ©)fvcbMLen;°dONLNdùD©P)l/*°dONLNd
  3400. ùV©¬)used internally */°dONLNd©rµê(≤rshort°dONLNd#©ÿµ )f vcbDirIndex;°dONLNd0©DµP)l/*°dONLNd3©Vµ¬)used internally */°dONLNdFµr¡ê(ærshort°dONLNdLµÿ¡)f
  3401. vcbDirBlk;°dONLNdWµD¡P)l/*°dONLNdZµV¡¬)used internally */°dONLNdm¡rÕ¿( r
  3402. unsigned long°dONLNd{¡ÿÕ)f vcbVolBkUp;°dONLNdá¡DÕP)l/*°dONLNdä¡VÕ‘)date and time of last°dONLNd•ÕVŸå*     backup */°dONLNdØŸrÂΔ(‚runsigned short°dONLNdæŸÿÂ)f vcbVSeqNum;°dONLNd ŸDÂP)l/*°dONLNdÕŸVÂ⁄)volume backup sequence°dONLNdÈÂVÒå*     number */°dONLNdÛÒr˝ä(˙rlong°dONLNd¯Òÿ˝)f    vcbWrCnt;°dONLNdÒD˝P)l/*°dONLNdÒV˝‘)volume write count */°dONLNd˝r    ä(rlong°dONLNd ˝ÿ     )f vcbXTClpSiz;°dONLNd-˝D    P)l/*°dONLNd0˝V    ⁄)clump size for extents°dONLNdL    V∂* overflow file */°dONLNd]r!ä(rlong°dONLNdbÿ! )f vcbCTClpSiz;°dONLNdoD!P)l/*°dONLNdrV!⁄)clump size for catalog°dONLNdé!V-Ä* file */°dONLNdñ-r9Δ(6runsigned short°dONLNd•-ÿ9 )f vcbNmRtDirs;°dONLNd≤-D9P)l/*°dONLNdµ-V9Ê)number of directories in°dONLNd”9VEò* root dir */°dONLNdflErQä(Nrlong°dONLNd‰EÿQ)f
  3403. vcbFilCnt;°dONLNdÔEDQP)l/*°dONLNdÚEVQ¬)number of files in°dONLNd
  3404. QV]å*     volume */°dONLNd]riä(frlong°dONLNd]ÿi)f
  3405. vcbDirCnt;°dONLNd$]DiP)l/*°dONLNd']ViÊ)number of directories in°dONLNdEiVuå*     volume */°dONLNdOurÅä(~rlong°dONLNdTuÿÅ2)fvcbFndrInfo[8];°dONLNdduDÅP)l/*°dONLNdguVŇ)information used by the°dONLNdÑÅVçå*     Finder */°dONLNdéçrôΔ(ñrunsigned short°dONLNdùçÿô)f
  3406. vcbVCSize;°dONLNd®çDôP)l/*°dONLNd´çVô¬)used internally */°dONLNdæôr•Δ(¢runsigned short°dONLNdÕôÿ•)f vcbVBMCSiz;°dONLNdŸôD•P)l/*°dONLNd‹ôV•¬)used internally */°dONLNdÔ•r±Δ(Ærunsigned short°dONLNd˛•ÿ±)f vcbCtlCSiz;°dONLNd
  3407. •D±P)l/*°dONLNd
  3408. •V±¬)used internally */°dONLNd ±rΩΔ(∫runsigned short°dONLNd/±ÿΩ )f vcbXTAlBlks;°dONLNd<±DΩP)l/*°dONLNd?±VΩÊ)size of extents overflow°dONLNd]ΩV…Ä* file */°dONLNde…r’Δ(“runsigned short°dONLNdt…ÿ’ )f vcbCTAlBlks;°dONLNdÅ…D’P)l/*°dONLNdÑ…V’‡)size of catalog file */°dONLNdú’r·ê(firshort°dONLNd¢’ÿ·)f    vcbXTRef;°dONLNd¨’D·P)l/*°dONLNdØ’V·‘)ref. num. for extents°dONLNd ·VÌ∂* overflow file */°dONLNd€Ìr˘ê(ˆrshort°dONLNd·Ìÿ˘)f    vcbCTRef;°dONLNdÎÌD˘P)l/*°dONLNdÓÌV˘‘)ref. num. for catalog°dONLNd    ˘VÄ* file */°dONLNdrÑ(rPtr°dONLNdÿ)f
  3409. vcbCtlBuf;°dONLNd DP)l/*°dONLNd#V¯)ptr. to extents and catalog°dONLNdDVå*     caches */°dONLNdNr)ä(&rlong°dONLNdSÿ))f
  3410. vcbDirIDM;°dONLNd^D)P)l/*°dONLNdaV)Ú)directory last searched */°dONLNd|)r5ê(2rshort°dONLNdÇ)ÿ5)f    vcbOffsM;°dONLNdå)D5P)l/*°dONLNdè)V5‡)offspring index at last°dONLNd¨5VAå*     search */°dONLNd∂ArM~(Jr};°dONLNdπMrY¸* typedef struct VCB VCB;°dONLNd—YreÍ* typedef VCB *VCBPtr;
  3411. °dONLNdÊvHÇÆ(HField descriptions°dONLNd˘êHúd*qLink°dONLNdˇê¥úı)lGA pointer to the next entry in the VCB queue. This field is initialized°dONLNdGú¥®‰* 6when the VCB is added to the VCB queue by UTAddNewVCB.°dONLNd~∞Hºf(πHqType°dONLNdÑ∞¥º˚)lFThe queue type. This field is initialized when the VCB is added to the°dONLNdÀº¥»T* VCB queue by UTAddNewVCB.(ÚH3-)
  3412. 4)&%Macintosh File System Data Structuresˇfdˇ ˇˇˇˇd
  3413. d,Times
  3414. .(3Ä The File System Utility Routines°dONLNdU`aã(^`vcbFlags°dONLNd    UÃa)lCVolume flags. Set bit 15 if the volume information has been changed°dONLNdMaÃmÓ* >by a File Manager call since the volume was last affected by a°dONLNdåmÃy* FlushVol call.°dONLNdõÅ`çú(ä`
  3415. vcbSigWord°dONLNd¶ÅÃçœ)l6The volume signature. This field must be set to $4244.°dONLNd›ï`°í(û`    vcbCrDate°dONLNdÁïð)lJSet to the date and time of volume creation (initialization), specified as°dONLNd2°Ã≠◊* 6the number of seconds since midnight, January 1, 1904.°dONLNdiµ`¡ì(æ`vcbLsMod°dONLNdrµÃ¡)lISet to the date and time of last modification, specified as the number of°dONLNdº¡ÃÕ˛* @seconds since midnight, January 1, 1904. This is not necessarily°dONLNd˝Õßp* !when the volume was last flushed.°dONLNd·`ÌÜ(Í`vcbAtrb°dONLNd'·ÃÌ≥)l0Volume attributes. The bits have these meanings:°dONLNdXÌÃ˘›* Bit°dONLNd\Ì˘2)6Meaning°dONLNdd˘Ãfi(Ã0–5°dONLNdh˘2)6    Reserved.°dONLNdrÓ(Ã6°dONLNdt)69Set this bit if the volume is busy (one or more files are°dONLNdØ!* open).°dONLNd∂Ã)“(&Ã7°dONLNd∏))6:Set this bit if the volume is locked by hardware. This can°dONLNdı)5Ï* /be obtained when the volume is mounted with the°dONLNd'5Ag* DriveStatus function.°dONLNd=AÃM‰(JÃ8–14°dONLNdBAM2)6    Reserved.°dONLNdLMÃYÿ(VÃ15°dONLNdOMY)6:Set this bit if the volume is locked by software. This bit°dONLNdåYe* 6can be set or cleared by programs calling your foreign°dONLNd≈eq* 2file system with _SetVInfo and you should store it°dONLNd˙q}y* between volume mounts.°dONLNdÖ`ëí(é`vcbNmFls°dONLNdÖÃë÷)l:Set to the number of files in the volume’s root directory.°dONLNdUô`•ï(¢`vcbVBMSt°dONLNd^ôÕ )lFFor HFS volumes, this field is used to point to the first block of the°dONLNd••ñ* Fvolume bitmap. Your foreign file system can use this field to point to°dONLNdϱÃΩ˚* Can analogous structure. If it doesn’t, the field’s value must be 0.°dONLNd0≈`—ò(Œ` vcbAllocPtr°dONLNd<≈× )lFFor HFS volumes, this field is used to point to the start block of the°dONLNdɗÛ* Inext allocation search. Your foreign file system can use this field for a°dONLNdÕ›ÃÈ⁄* <similar purpose. If it doesn’t, the field’s value must be 0.°dONLNd
  3416. Ò`˝§(˙` vcbNmAlBlks°dONLNdÒÃ˝˜)l=Set to the number of allocation blocks in the volume (maximum°dONLNdT˝Ã    * B$FFFF).This field, together with the vcbAlBlkSiz field, is used to°dONLNdó    Ã* Adetermine the number of bytes on a particular volume.  It must be°dONLNdŸÃ!Ô* =initialized to a value which when multiplied with vcbAlBlkSiz°dONLNd!Ã-«* 7provides a reasonable estimate of the size of the disk.°dONLNdO5`Aú(>` vcbAlBlkSiz°dONLNd[5ÃA)lJSet to the allocation block size (in bytes). This field, together with the°dONLNd¶AÃM* BvcbNmAlBlks field, is used by the Finder and other applications to°dONLNdÈMÃY* Adetermine the number of bytes on a particular volume.  It must be°dONLNd+YÃeù* -initialized to some non-zero multiple of 512.°dONLNdYm`yë(v`    vcbClpSiz°dONLNdcmÃy
  3417. )lESet to the default clump size. For HFS volumes, this field is used to°dONLNd©yÃÖ* Edetermine how many new allocation blocks to allocate when the file is°dONLNdÔÖÃëˇ* Bextended. Your foreign file system can use this field for the same°dONLNd    2ëÃùÍ* @purpose, but in any case, it must set its value to a multiple of°dONLNd    sùé"* vcbAlBlkSiz or 0.+iL%Macintosh File System Data Structures)÷3-)
  3418. 5ˇdˇ ˇˇˇˇd
  3419. d,Times
  3420. .+H3 Guide to the File System Manager°dONLNdWHcy*-    vcbAlBlSt°dONLNd
  3421. W¥c˚)lFSet to the first allocation block in the volume. For HFS volumes, this°dONLNdQc¥oÂ* Eis the number of the first block used for files. If your foreign file°dONLNdóo¥{È* Dsystem has an analogous structure (that is, if its header blocks are°dONLNd‹{¥á* Kfollowed by a contiguous set of blocks for files), it can use this field in°dONLNd(á¥ìû* 4the same way. If not, it must leave this field zero.°dONLNd]õHßà(§H
  3422. vcbNxtCNID°dONLNdhõ¥ßÛ)lBThe next unused catalog node ID (directory ID or file ID). For HFS°dONLNd´ß¥≥È* Avolumes, this is set to fsUsrCNID when the volume is initialized.°dONLNdÌ≥¥øÛ* BWhen a new directory or file is created, vcbNxtCNID is used as the°dONLNd0ø¥À¸* Fdirectory ID or file ID and then incremented. Your foreign file system°dONLNdwÀ¥◊–* >can use this field for the same purpose, or may leave it zero.°dONLNd∂flHÎÅ(ËH
  3423. vcbFreeBks°dONLNd¡fl¥Î—)l;Set to the number of unused allocation blocks on the volume°dONLNd˝Î¥˜ˇ* B(maximum $FFFF). This field, together with vcbAlBlkSiz, is used by°dONLNd@˜¥* Gthe Finder and other applications to determine the number of free bytes°dONLNdà¥˘* Fin the volume. It must be initialized to a value which when multiplied°dONLNdœ¥ˆ* Dwith vcbAlBlkSiz provides a reasonable estimate of the free space in°dONLNd¥'Ï* the volume.°dONLNd /H;j(8HvcbVN°dONLNd&/¥;¯)lESet to the volume name. This field consists of a length byte followed°dONLNdl;¥G‹* <by 27 bytes. Note that the volume name can occupy at most 27°dONLNd©G¥SÛ* Fcharacters; this is an exception to the normal file and directory name°dONLNdS¥_ˇ* Elimit of 31 characters. The volume name must conform to the rules for°dONLNd6_¥k* FHFS volumes (i.e., no colon characters). For file systems that have no°dONLNd}k¥w* Bvolume-naming conventions, some standard name (such as “Untitled”)°dONLNd¿w¥É
  3424. * must be provided.°dONLNd“ãHóÉ(îH    vcbDrvNum°dONLNd‹ã¥óÚ)lBThe drive number of the drive on which the volume is located. This°dONLNdó¥£›* >field is initialized when the VCB is added to the VCB queue by°dONLNd^£¥Øfl* 7UTAddNewVCB. When a mounted volume is placed offline or°dONLNdñØ¥ªJ* ejected, vcbDrvNum is set to 0.°dONLNd∂√Hœä(ÃH
  3425. vcbDRefNum°dONLNd¡√¥œ¯)lDThe driver reference number of the driver used to access the volume.°dONLNdœ¥€ı* CThis field is initialized when the VCB is added to the VCB queue by°dONLNdJ€¥Áˆ* ;UTAddNewVCB. When a volume is ejected, vcbDRefNum is set to°dONLNdÜÁ¥Ûı* Athe previous value of vcbDrvNum (and hence is a positive number).°dONLNd»Û¥ˇ˜* BWhen a volume is placed offline, vcbDRefNum is set to the negative°dONLNd ˇ¥ ’* ;of the previous value of vcbDrvNum (and hence is a negative°dONLNdG ¥‡* number).°dONLNdPH+s((HvcbFSID°dONLNdX¥+È)lEAn identifier for the file system handling the volume; it is zero for°dONLNdû+¥7fi* ;volumes handled by the File Manager and nonzero for volumes°dONLNd⁄7¥CÔ* Ehandled by other file systems. Set to your foreign file system’s file°dONLNd     C¥OË*
  3426. system ID.°dONLNd    +WHcä(`H
  3427. vcbVRefNum°dONLNd    6W¥c˘)lCThe volume reference number. This field is initialized when the VCB°dONLNd    zc¥oõ* )is added to the VCB queue by UTAddNewVCB.°dONLNd    §wHÉu(ÄHvcbMAdr°dONLNd    ¨w¥É3)lUsed internally. Reserved.°dONLNd    «ãHó}(îH    vcbBufAdr°dONLNd    —ã¥ó3)lUsed internally. Reserved.°dONLNd    ÏüH´u(®HvcbMLen°dONLNd    Ùü¥´3)lUsed internally. Reserved.°dONLNd
  3428. ≥HøÉ(ºH vcbDirIndex°dONLNd
  3429. ≥¥ø3)lUsed internally. Reserved.°dONLNd
  3430. 6«H”y(–H    vcbDirBlk°dONLNd
  3431. @«¥”3)lUsed internally. Reserved.(ÚH3-)
  3432. 6)&%Macintosh File System Data Structuresˇ‘dˇ ˇˇˇˇd
  3433. d,Times
  3434. .(3Ä The File System Utility Routines°dONLNdU`aü(^`
  3435. vcbVolBkUp°dONLNd UÃa)lDSet to the date and time of the last volume backup, specified as the°dONLNdPaÃmΔ* 2number of seconds since midnight, January 1, 1904.°dONLNdÉu`Å£(~`
  3436. vcbVSeqNum°dONLNdéuÃÅK)lUsed internally. Reserved.°dONLNd©â`ïë(í`vcbWrCnt°dONLNd≤âÃï¸)l@The volume write count. This field is incremented every time the°dONLNdÛïð* Bvolume is written to by the Macintosh file system’s cache. If your°dONLNd6°Ã≠* Cforeign file system uses the Macintosh file system’s cache, it must°dONLNdz≠Ãπ* Ieither initialize this field to zero when a volume is mounted, or it must°dONLNdƒπÃ≈* Kinitialize this field to zero the first time the volume is mounted and then°dONLNd≈×
  3437. * Csave the current value of this field when a volume is unmounted and°dONLNdT—Û* Drestore the value when the volume is mounted again to keep a running°dONLNdô›ÃÈZ* count of writes to the volume.°dONLNd∏Ò`˝°(˙` vcbXTClpSiz°dONLNdƒÒÃ˝Ã)l6The clump size of the extents overflow file. Reserved.°dONLNd˚`†(` vcbCTClpSiz°dONLNdÃû)l-The clump size of the catalog file. Reserved.°dONLNd5`%¢("` vcbNmRtDirs°dONLNdAÃ% )lHSet to the number of directories in the root directory or leave it zero.°dONLNdä-`9è(6`    vcbFilCnt°dONLNdî-Ã9’)l:Set to the number of files on the volume or leave it zero.°dONLNdœA`Më(J`    vcbDirCnt°dONLNdŸAÃM)lFSet to the number of directories on the volume (not including the root°dONLNd MÃYF* directory) or leave it zero.°dONLNd=a`mú(j` vcbFndrInfo°dONLNdIaÃm)lCInformation used by the Finder. For HFS volumes, this field is used°dONLNdçmÃyÎ* >internally by HFS. Leave it all zeroes until set by _SetVInfo.°dONLNdÃÅ`çï(ä`    vcbVCSize°dONLNd÷ÅÃçK)lUsed internally. Reserved.°dONLNdÒï`°¢(û`
  3438. vcbVBMCSiz°dONLNd¸ïðK)lUsed internally. Reserved.°dONLNd©`µñ(≤`
  3439. vcbCtlCSiz°dONLNd"©ÃµK)lUsed internally. Reserved.°dONLNd=Ω`…ü(Δ`
  3440. vcbXTAlBks°dONLNdHΩÃ…‚)l<The size (in blocks) of the extents overflow file. Reserved.°dONLNdÖ—`›û(⁄`
  3441. vcbCTAlBks°dONLNdê—Û¥)l3The size (in blocks) of the catalog file. Reserved.°dONLNdƒÂ`Òí(Ó`vcbXTRef°dONLNdÕÂÃÒ)lBThe path reference number for the extents overflow file. Reserved.°dONLNd˘`ë(`vcbCTRef°dONLNd˘ÃŸ)l9The path reference number for the catalog file. Reserved.°dONLNdS
  3442. `ë(`    vcbCtlBuf°dONLNd]
  3443. à)l6A pointer to the extents and catalog caches. Reserved.°dONLNdî!`-ñ(*`    vcbDirIDM°dONLNdû!Ã-˚)l@The directory last searched. For HFS volumes, this field is used°dONLNdfl-Ã9* Cinternally by HFS to optimize GetCatInfo and GetFInfo. Your foreign°dONLNd#9ÃE* Dfile system can use this field for the same purpose, or may leave it°dONLNdhEÃQ‰* zero.°dONLNdnY`eê(b`vcbOffsM°dONLNdwYÃe)lFThe offspring index at the last search. For HFS volumes, this field is°dONLNdæeÃq * @used internally by HFS to optimize GetCatInfo and GetFInfo. Your°dONLNdˇqÃ}* Cforeign file system can use this field for the same purpose, or may°dONLNdC}Ãâ* leave it zero.°dONLNdRõ`߉(§`SThere are also three File System Utility routines that let you search the VCB queue°dONLNd¶≥løp+ •°dONLNd®≥yø)
  3444. JUTLocateVCBByRefNum searches for the VCB using a working directory number,°dONLNdÛøyÀD* (volume reference number, or drive number+º*%Macintosh File System Data Structures)÷3-)
  3445. 7ˇÜdˇ ˇˇˇˇd
  3446. d,Times
  3447. .+H3 Guide to the File System Manager°dONLNdUTaX+ +•°dONLNdUaa≤)
  3448. ?UTLocateVCBByName searches for the first VCB with a volume name°dONLNdBmTyX(vT•°dONLNdDmayÙ)
  3449. LUTLocateNextVCB searches the VCB queue for the next VCB with the volume name°dONLNdëyaÖ˜* Npassed to UTLocateVCBByName (the Macintosh file system allows multiple mounted°dONLNd‡Öaë * %volumes to have the same volume name),     Helvetica
  3450. °dONLNd£H≤0(ÆHMaximum Volume and File Sizes
  3451. °dONLNd$ΩH…˜*VThe maximum volume size supported by the current File Manager programming interface is°dONLNd{…H’fi* Uslightly less than 4 Gigabytes. The exact number is the maximum allocation block size°dONLNd—’H·”* N($FE00) multiplied by the maximum number of allocation blocks ($FFFF) — that’s°dONLNd ·Ḧ* U$FDFF0200 or 4261347840 decimal. To access volumes 2 Gigabytes or larger (larger than°dONLNdvÌH˘’* M$7FFFFFFF or 2147483647 decimal), your foreign file system must used unsigned°dONLNdƒ˘HÚ* Wlongword values when determining volume offsets and disk drivers called by your foreign°dONLNdH* ]file system must assume that the position passed to Read and Write requests in ioPosOffset is°dONLNdzH“* an unsigned longword value.°dONLNdñ)H5€*RHowever, many applications, including versions of the Macintosh Finder, use signed°dONLNdÈ5HAÊ* Slongword values when determining volume size and volume freespace. Because of this,°dONLNd=AHMs* <volumes 2 Gigabytes or larger may cause unexpected behavior.°dONLNdzYHe˝*XStarting with System 7.5, the Macintosh Finder has been changed to use unsigned longword°dONLNd”eHq‡* Rvalues when determining volume size and volume freespace. The File Manager routine°dONLNd&qH}”* OPBHGetVInfo has also been changed starting with System 7.5 to pin the number of°dONLNdv}Hâı* Vallocation blocks (vcbNmAlBlks) and the number of free allocation blocks (vcbNmAlBlks)°dONLNdÕâHï* `so that when multiplied by the allocation block size (vcbAlBlkSiz), the result will be less than°dONLNd.ïH°Â* V2 Gigabytes. This prevents unexpected behavior from other applications that use signed°dONLNdÖ°H≠È* Rlongwords when determining volume size and volume freespace. The values in the VCB°dONLNdÿ≠Hπ¸* Wfields vcbNmAlBlks and vcbNmAlBlks are not changed. Listing 3-1 illustrates how you use°dONLNd0πH≈* [Gestalt to determine if 4 Gigabyte volumes are supported by the Macintosh operating system.°dONLNdå—°›Â+Y Listing 3-1.°dONLNdò—›©)D'  Testing for 4 Gigabyte volume support,
  3452. Courier
  3453. °dONLNd¿ÊHÚr(ÔHBoolean°dONLNd»Ê~Úfi)6Has4GBVols(void)°dONLNdŸÚH˛N(˚H{°dONLNd‹˛Z
  3454. Æ+ long response;°dONLNdÓZ"t*/if (Gestalt(gestaltFSAttr, &response) == noErr)°dONLNd "l.‘+ <return ((response & (1L << gestaltFSSupports4GBVols)) != 0);°dONLNd^.Z:r(7Zelse°dONLNde:lFΔ+ return (false);°dONLNduFHRN(OH}
  3455. °dONLNdweHq„*TThe maximum file size supported by the current File Manager programming interface is°dONLNdÃqH}˘* S2 Gigabytes - 1 byte ($7FFFFFFF or 2147483647 decimal) because File Manger Read and°dONLNd     }Hâb* :Write requests use ioPosOffset as a signed longword value.*l3-)
  3456. 8)&%Macintosh File System Data Structuresˇ@dˇ ˇˇˇˇd
  3457. d,Times
  3458. .(3Ä The File System Utility Routines,     Helvetica
  3459. °dONLNdU`dÁ(``File Control Blocks d^d
  3460. °dONLNdq`}*^Each time a file is opened on a volume owned by a foreign file system, the foreign file system°dONLNds}`â    * \must read that file’s catalog entry and build a file control block (FCB) in the FCB array. A°dONLNd–â`ïk* 4new FCB is obtained with the UTAllocateFCB function.°dONLNd°`≠*]When a file is closed, the foreign file system must mark the FCB free and release it with the°dONLNdc≠`πŸ* UTReleaseFCB function.°dONLNdz≈`—¥*IThe structure of a file control block is defined by the FCBRec data type.,
  3461. Courier
  3462. °dONLNdƒÊlÚΔ+ !struct FCBRec {°dONLNd‘Úä˛ÿ+
  3463. unsigned long°dONLNd‚Ú˛ )ffcbFlNm;°dONLNdÎÚ\˛)l/* FCB file number. Non-zero°dONLNd
  3464. ˛n
  3465. ‘+ marks FCB used */°dONLNd
  3466. äΔ(ä
  3467. SignedByte°dONLNd*
  3468. &)f    fcbFlags;°dONLNd4
  3469. \∂)l/* FCB flags */°dONLNdDä"Δ(ä
  3470. SignedByte°dONLNdO",)f
  3471. fcbTypByt;°dONLNdZ\"‘)l/* File type byte */°dONLNdo"ä.fi(+äunsigned short°dONLNd~".&)f    fcbSBlk; °dONLNdà"\.Ê)l/* File start block (in°dONLNd•.n:
  3472. + allocation size blocks) */°dONLNd¿:äFÿ(Cä
  3473. unsigned long°dONLNdŒ:F)ffcbEOF;°dONLNd÷:\F˛)l/* Logical length or EOF in°dONLNd˜FnRû+ bytes */°dONLNdRä^ÿ([ä
  3474. unsigned long°dONLNdR^ )ffcbPLen;°dONLNdR\^¯)l/* Physical file length in°dONLNd7^njû+ bytes */°dONLNd@jävÿ(sä
  3475. unsigned long°dONLNdNjv )ffcbCrPs;°dONLNdWj\v¯)l/* Current position within°dONLNdwvnÇò+ file */°dONLNdÇäéÆ(ãäVCBPtr°dONLNdÜÇé )ffcbVPtr;°dONLNdèÇ\é¬)l/* Pointer to the°dONLNd¶énöÊ+ corresponding VCB */°dONLNdªöä¶ú(£äPtr°dONLNdøö¶&)f    fcbBfAdr;°dONLNd…ö\¶˛)l/* File's buffer address */°dONLNd¶ä≤fi(Øäunsigned short°dONLNdÙ¶≤&)f    fcbFlPos;°dONLNd˛¶\≤)l/* Directory block this file°dONLNd ≤næû+ is in */°dONLNd)æä ÿ(«ä
  3476. unsigned long°dONLNd7æ 8)f fcbClmpSize;°dONLNdDæ\ ‡)l/* Number of bytes per°dONLNd` n÷û+ clump */°dONLNdi÷ä‚ú(fläPtr°dONLNdm÷‚2)f fcbBTCBPtr;°dONLNdy÷\‚
  3477. )l/* Pointer to B*-Tree control°dONLNdú‚nÓÚ+ block for this file */°dONLNd≥Óä˙ÿ(˜ä
  3478. unsigned long°dONLNd¡Ó˙>)f
  3479. fcbExtRec[3];°dONLNdœÓ\˙¯)l/* First 3 file extents */°dONLNdÍ˙äÆ(äOSType°dONLNdÒ˙&)f    fcbFType;°dONLNd˚˙\Ê)l/* File's 4 Finder Type°dONLNdnû+ bytes */°dONLNd!äÿ(ä
  3480. unsigned long°dONLNd/,)f
  3481. fcbCatPos;°dONLNd:\¯)l/* Catalog hint for use on°dONLNdZn*û+ Close */°dONLNdc*ä6ÿ(3ä
  3482. unsigned long°dONLNdq*6&)f    fcbDirID;°dONLNd{*\6Ú)l/* Parent Directory ID */°dONLNdï6äB®(?äStr31°dONLNdõ6B&)f    fcbCName;°dONLNd•6\BÏ)l/* CName of open file */°dONLNdæBäNñ(Kä};°dONLNd¡NäZ8* typedef struct FCBRec FCBRec;°dONLNdflZäf&* typedef FCBRec *FCBRecPtr;
  3483. °dONLNd˙É`èΔ(å`Field descriptions°dONLNd
  3484. ù`©ë*fcbFlNum°dONLNdùé    )lESet to the file ID of this file. File numbers less than fsUsrCNID are°dONLNd\©Ãµ>* considered system files.+i@%Macintosh File System Data Structures)÷3-)
  3485. 9ˇrdˇ ˇˇˇˇd
  3486. d,Times
  3487. .+H3 Guide to the File System Manager°dONLNdWHcq*-fcbFlags°dONLNd    W¥c¸)lIFlags describing the status of the file. Currently the following bits are°dONLNdSc¥o⁄* defined:°dONLNd\o¥{≈* Bit°dONLNdao2{b)~Meaning°dONLNdi{¥á∫(Ñ¥0°dONLNdk{œá) fcbWriteBit°dONLNdw{2á’)c&Set if data can be written to the file°dONLNdûá¥ì∫(ê¥1°dONLNd†áœì)fcbResourceBit°dONLNdØá2ìÚ)c)Set if this FCB describes a resource fork°dONLNdŸì¥ü∫(ú¥2°dONLNd€ìœü))fcbWriteLockedBit°dONLNdÌì2üfl)c'Set if the file has a locked byte range°dONLNdü¥´∫(®¥3°dONLNdü2´^)~Reserved°dONLNd!´¥∑∫(¥¥4°dONLNd#´œ∑')fcbSharedWriteBit°dONLNd5´2∑æ)c Set if the file has shared write°dONLNdY∑2√k* permissions°dONLNde√¥œ∫(Ã¥5°dONLNdg√œœ!)fcbFileLockedBit°dONLNdx√2œÌ)c+Set if the file is locked (write-protected)°dONLNd§œ¥€∫(ÿ¥6°dONLNd¶œœ€#)fcbOwnClumpBit°dONLNdµœ2€)c,Set if the file’s clump size is specified in°dONLNd€2ÁZ* the FCB°dONLNdÌÁ¥Û∫(¥7°dONLNdÔÁœÛ)fcbModifiedBit°dONLNd˛Á2Û¯)c-Set if the file has changed since it was last°dONLNd/Û2ˇU* flushed°dONLNd7Ho(HfcbSBlk°dONLNd?¥È)l?Used internally for volumes owned by the Macintosh file system.°dONLNd¥‚* AYour foreign file system can use this field for its own purposes.°dONLNd¡'H3m(0HfcbEOF°dONLNd»'¥3k)l+Set to the logical end-of-file of the file.°dONLNdÙ;HGp(DHfcbPLen°dONLNd¸;¥Gs)l,Set to the physical end-of-file of the file.°dONLNd)OH[o(XHfcbCrPs°dONLNd1O¥[F)l Set to the position of the mark.°dONLNdRcHom(lHfcbVPtr°dONLNdZc¥o˜)lESet to point to the volume control block of the volume containing the°dONLNd†o¥{«* file.°dONLNd¶ÉHèu(åHfcbBfAdr°dONLNdØÉ¥èÑ)l-Reserved for internal use by the file system.°dONLNd›óH£s(†HfcbFlPos°dONLNdÊó¥£È)l?Used internally for volumes owned by the Macintosh file system.°dONLNd&£¥Ø‚* AYour foreign file system can use this field for its own purposes.°dONLNdh∑H√Ö(¿H fcbClmpSize°dONLNdt∑¥√I)l"Set to the clump size of the file.°dONLNdóÀH◊Ñ(‘H
  3488. fcbBTCBPtr°dONLNd¢À¥◊Ñ)l-Reserved for internal use by the file system.°dONLNd–flHÎy(ËH    fcbExtRec°dONLNd⁄fl¥ÎÛ)lCFor HFS volumes, this is an extent record (12 bytes) containing the°dONLNdÎ¥˜* Lfirst three extents of the file. Your foreign file system can use this field°dONLNdk˜¥* for its own purposes.°dONLNdÅ Hv(HfcbFType°dONLNdä ¥8)lSet to the file’s Finder type.°dONLNd©H+y((H    fcbCatPos°dONLNd≥¥+˜)lCFor HFS volumes, a catalog hint, used when the file is closed. Your°dONLNd˜+¥7«* <foreign file system can use this field for its own purposes.°dONLNd4?HKr(HHfcbDirID°dONLNd=?¥Kh)l&The file’s parent directory ID number.°dONLNddSH_{(\HfcbCName°dONLNdmS¥_Ò)lDThe file’s name. This field consists of a length byte followed by 31°dONLNd≤_¥kÓ* Abytes. The file name must conform to the rules for HFS file names°dONLNdÙk¥wˆ* F(i.e., no colon characters). For file systems that have no file-naming°dONLNd;w¥É›* <conventions, some standard name (such as “Untitled”) must be°dONLNdxÉ¥è‚*     provided.°dONLNdǰH≠ƒ(™HRThere are also four File System Utility routines that let you search the FCB array°dONLNd’πT≈X+ •°dONLNd◊πa≈È)
  3489. PUTLocateFCB lets you find a FCB on a particular volume by file number or by file°dONLNd(≈a—z* name(ÚH3-)
  3490. 10)&%Macintosh File System Data Structuresˇ4dˇ ˇˇˇˇd
  3491. d,Times
  3492. .(3Ä The File System Utility Routines°dONLNdUlap(^l•°dONLNdUya)
  3493. PUTLocateNextFCB resumes searching for a FCB by file number or file name from the°dONLNdSaymfl* GFCB found by UTLocateFCB (the same file can have multiple access paths)°dONLNdõylÖp(Çl•°dONLNdùyyÖˆ)
  3494. OUTIndexFCB lets you find, one at a time, all of the FCBs on a particular volume°dONLNdÌëlùp(öl•°dONLNdÔëyù‚)
  3495. HUTResolveFCB returns a pointer to a FCBRec given a file reference number°dONLNd8©lµã(≤lNote:°dONLNd=©ãµ˝)O If your foreign file system attempts to allocate a FCB in response to an _Open°dONLNdçµl¡¸(ælQcall and UTAllocateFCB cannot find a free FCB in the FCB array, you should return°dONLNdfl¡lÕÔ* Othe tmfoErr result from UTAllocateFCB as your result. The Macintosh file system°dONLNd/ÕlŸˇ* Xwill then attempt to enlarge the FCB array and if successful, will retry the _Open call.°dONLNdâŸlÂÌ* OBecause enlarging the FCB array will change the array’s location in memory, you°dONLNdŸÂlÒ* Ushould never save the location of a FCBRec between calls to your foreign file system.°dONLNd/Òl˝·* MA FCBRecPtr can only be used within the context of one file system operation.,     Helvetica
  3496. °dONLNd}`*M(&` Working Directory Control Blocks *^*
  3497. °dONLNdû7`C
  3498. *YWorking directories allow applications that use the old MFS File Manager routines to work°dONLNd¯C`O* Xon volumes with directory trees. Working directories allow the use of a volume reference°dONLNdQO`[Ú* Rnumber to specify both a volume and a directory on the volume. Each time a working°dONLNd§[`g* \directory is opened on a volume owned by a foreign file system, the foreign file system must°dONLNdg`sŒ* Ibuild a working directory control block (WDCB) in the WDCB array with the°dONLNdKs`Á* UTAllocateWDCB function.°dONLNddã`ó
  3499. *WWhen a working directory is closed, the foreign file system must mark the WDCB free and°dONLNdºó`£* Urelease it with the UTReleaseWDCB function. When a volume is unmounted and its VCB is°dONLNd£`Ø›* Ldisposed of, UTDisposeVCB closes all working directories open on the volume.°dONLNd_ª`«*WThe structure of a working directory control block is defined by the WDCBRec data type.,
  3500. Courier
  3501. °dONLNd∑‹lËÃ+ !struct WDCBRec {°dONLNd»ËäÙÆ+ VCBPtr°dONLNdœËÙ&)f    wdVCBPtr;°dONLNdŸË\ÙÚ)l/* Pointer to VCB of this°dONLNd¯ÙnÊ+ working directory */°dONLNd
  3502. ä ¢(    älong°dONLNd  )fwdDirID;°dONLNd\ )l/* Directory ID number of this°dONLNd? nÊ+ working directory */°dONLNdTä$¢(!älong°dONLNdY$,)f
  3503. wdCatHint;°dONLNdd\$Ï)l/* Hint for finding this°dONLNdÇ$n0Ê+ working directory */°dONLNdó0ä<¢(9älong°dONLNdú0<&)f    wdProcID;°dONLNd¶0\<)l/* Process that created this°dONLNd»<nHÊ+ working directory */°dONLNd›HäTñ(Qä};°dONLNd‡Tä`D* typedef struct WDCBRec WDCBRec;°dONLNd`äl2* typedef WDCBRec *WDCBRecPtr;
  3504. °dONLNd}`âΔ(Ü`Field descriptions°dONLNd0ó`£ï*wdVCBPtr°dONLNd9óã)lDA pointer to the VCB of the volume this working directory refers to.°dONLNd~´`∑ä(¥`wdDirID°dONLNdÜ´Ã∑)lFThe directory ID number of the directory this working directory refers°dONLNdÕ∑Ã√Ÿ* to.+i2%Macintosh File System Data Structures)–3-)
  3505. 11ˇédˇ ˇˇˇˇd
  3506. d,Times
  3507. .+H3 Guide to the File System Manager°dONLNdUHa|*+    wdCatHint°dONLNd
  3508. U¥a„)lBThe Macintosh file system stores a hint so it can quickly find the°dONLNdMa¥m˛* Gdirectory the working directory refers to. Your foreign file system can°dONLNdïm¥yY* $use this field for its own purposes.°dONLNd∫ÅHçy(äHwdProcID°dONLNd√Å¥çª)l3The process ID number passed to the OpenWD request.°dONLNd˜üH´’(®HMThe File System Utility routine UTResolveWDCB lets you search the WDCB array.°dONLNdE´H∑* UUTResolveWDCB lets you find a WDCB by working directory reference number, or lets you°dONLNdõ∑H√«* Pfind, one at a time, all WDCBs or all of the WDCBs with a particular process ID.°dONLNdÏœT€s+ Note:°dONLNdÒœs€œ)J If your foreign file system attempts to allocate a WDCB in response to an°dONLNd<€TÁÊ(‰TJ_OpenWD call and UTAllocateWDCB cannot find a free WDCB in the WDCB array,°dONLNdáÁTÛ–* Lyou should return the tmfoErr result from UTAllocateWDCB as your result. The°dONLNd‘ÛTˇÂ* TMacintosh file system will then attempt to enlarge the WDCB array and if successful,°dONLNd)ˇT ‘* Nwill retry the _OpenWD call.  Because enlarging the WDCB array will change the°dONLNdx T«* Jarray’s location in memory, you should never save the location of WDCBRecs°dONLNd√T#€* Obetween calls to your foreign file system. A WDCBRecPtr can only be used within°dONLNd#T/* )the context of one file system operation.,     Helvetica
  3509. °dONLNd=MH\È(XHDrive Queue Elements \F\
  3510. °dONLNdRiHuÚ*\The File Manager maintains a list of all disk drives connected to the computer. It maintains°dONLNdØuHŘ* \this list in the drive queue, which is a standard Operating System queue. The drive queue is°dONLNd ÅHçˇ* `initially created at system startup time. Elements are added to the queue at system startup time°dONLNdmçHô˝* Zor when the AddDrive function is called. The drive queue can support any number of drives,°dONLNd»ôH•Û* Xlimited only by memory space. Each element in the drive queue contains information about°dONLNd!•H±¸* ]the corresponding drive; the structure of a drive queue element is defined by the DrvQEl data°dONLNd±HΩ`* type.°dONLNdÖ…H’Û*ZGiven a drive number, the UTFindDrive File System Utility routine will return a pointer to°dONLNd‡’H·Ç* Ethe associated drive queue element if it is found in the drive queue.,
  3511. Courier
  3512. °dONLNd&ˆTÆ+ !struct DrvQEl {°dONLNd6r¢+ QElemPtr°dONLNd?ÿ¸)fqLink;°dONLNdFD»)l/* Next queue entry */°dONLNd]rê(rshort°dONLNdcÿ¸)fqType;°dONLNdjDŒ)l/* Flag for dQDrvSz and°dONLNdáV&ò+ dQDrvSz2 */°dONLNdì&r2ê(/rshort°dONLNdô&ÿ2)fdQDrive;°dONLNd¢&D2∞)l/* Drive number */°dONLNdµ2r>ñ(;rshort °dONLNdº2ÿ>)f    dQRefNum;°dONLNdΔ2D>Ú)l/* Driver reference number */°dONLNd‰>rJê(Grshort°dONLNdÍ>ÿJ)fdQFSID;°dONLNdÚ>DJº)l/* File system ID */°dONLNdJrVΔ(Srunsigned short°dONLNdJÿV)fdQDrvSz;°dONLNdJDV¯)l/* Number of logical blocks on°dONLNdCVVbÜ+ drive */°dONLNdLbrnΔ(krunsigned short°dONLNd[bÿn)f    dQDrvSz2;°dONLNdebDnÚ)l/* Additional field for large°dONLNdànVzå+     drives */°dONLNdízrÜ~(Ér};°dONLNdïÜrí * typedef struct DrvQEl DrvQEl;°dONLNd≥írû* typedef DrvQEl *DrvQElPtr;
  3513. (ÚH3-)
  3514. 12)&%Macintosh File System Data Structuresˇ dˇ ˇˇˇˇd
  3515. d,Times
  3516. .(3Ä The File System Utility Routines°dONLNdU`aΔ(^`Field descriptions°dONLNdo`{|*qLink°dONLNdoÃ{
  3517. )lIA pointer to the next entry in the drive queue. This field is initialized°dONLNdc{Ãá›* 8when the drive is added to the drive queue by _AddDrive.°dONLNdúè`õ~(ò`qType°dONLNd¢èÃõ
  3518. )lFThe queue type. Used to specify the size of the drive. If the value of°dONLNdÈõÃß
  3519. * EqType is 0, the number of logical blocks on the drive is contained in°dONLNd/ßÃ≥* Ethe dQDrvSz field alone. If the value of qType is 1, both dQDrvSz and°dONLNdu≥ÃøÛ* >dQDrvSz2 are used to store the number of blocks; in that case,°dONLNd¥øÃÀ* @dQDrvSz2 contains the high-order word of this number and dQDrvSz°dONLNdıÀÃ◊V* contains the low-order word.°dONLNdfl`Îà(Ë`dQDrive°dONLNdflÃÎ)lGThe drive number of the drive. This field is initialized when the drive°dONLNdbÎØî* )is added to the drive queue by _AddDrive.°dONLNdåˇ` ó(`dQRefNum°dONLNdïˇÃ )lCThe driver reference number of the driver controlling the device on°dONLNdŸ Ã* Hwhich the volume is mounted. This field is initialized when the drive is°dONLNd"Ã#â* &added to the drive queue by _AddDrive.°dONLNdI+`7à(4`dQFSID°dONLNdP+Ã7)lIAn identifier for the file system handling the volume in the drive; it is°dONLNdö7ÃCÛ* <zero for volumes handled by the File Manager and nonzero for°dONLNd◊CÃOÖ* &volumes handled by other file systems.°dONLNd˛W`cå(``dQDrvSz°dONLNdWÃcï)l*The number of logical blocks on the drive.°dONLNd1k`wí(t`dQDrvSz2°dONLNd:kÃw)lJAn additional field to handle large drives. This field is used only if the°dONLNdÖwÃÉ* =qType field contains 1 and then, contains the high-order word°dONLNd√ÉÃè≈* 5specifying the number of logical blocks on the drive.,
  3520.  
  3521. Zapf Dingbats
  3522. °dONLNd˘°l≠w(´ls°dONLNd˚¢~Æ≤)Warning:°dONLNd¢≤Æ˘)4B  If the device driver whose reference number is dQRefNum supports°dONLNdFÆ~∫˝(∑~Sthe Return Format List _Status call (csCode = 6), the volSize field in the returned°dONLNdö∫~Δ˚* MFormatListRec with the diCIFmtFlagsCurrentBit set should be used to determine°dONLNdËΔ~“* Nthe number of blocks instead of the dQDrvSz and dQDrvSz2 fields in the DrvQEl.°dONLNd7“~fi˘* ODrivers that support Return Format List (for example, the .Sony driver) may not°dONLNdáfi~Í˙* Lsupport the dQDrvSz and dQDrvSz2 fields or may use them for other purposes. 
  3523.     °dONLNd”‡˙È(Á˙s
  3524. °dONLNd’¸`(`[There are also four flag bytes preceding each drive queue element. The four flag bytes must°dONLNd1`* \be allocated by the disk driver at the same time the drive queue element is allocated. These°dONLNdé` * (bytes contain the following information:°dONLNd∑8lDÜ+ $Byte°dONLNdº8ñD»)*Contents°dONLNd≈Pl\r(Yl0°dONLNd«Pñ\c)*,Bit 7=1 if the volume on the drive is locked°dONLNdÙ\lhr(el1°dONLNdˆ\ñhÒ)*P0 if no disk in drive; 1 or 2 if disk in drive; 8 if nonejectable disk in drive;°dONLNdIhñt˙* L$FC–$FF if disk was ejected within last 1.5 seconds; $48 if disk in drive is°dONLNdòtñÄ;* $nonejectable but driver wants a call°dONLNdΩÄlår(âl2°dONLNdøÄñåG)*%Used internally during system startup°dONLNdÂålòr(ïl3°dONLNdÁåñò")*Bit 7=0 if disk is single-sided°dONLNd    ∞`º˘(π`VYou can read these flags by subtracting 4 from the beginning of a drive queue element.+’9%Macintosh File System Data Structures)–3-)
  3525. 13ˇdˇ ˇˇˇˇd
  3526. d,Times
  3527. .+H3 Guide to the File System Manager°dONLNdUHa˚*+ZAfter successfully mounting a volume, a foreign file system should change the dqFSID field°dONLNd[aHm‰* Win the drive queue element to the foreign file system’s file system ID number. When the°dONLNd≥mHyÒ* Nvolume is unmounted and the VCB is disposed of with UTDisposeVCB, UTDisposeVCB°dONLNdyHÖπ* Rwill clear the dqFSID field in the drive queue element if the device is ejectable.°dONLNdUëHùÒ*XThe dqFSID field in drive queue elements for the Macintosh floppy disk drives are always°dONLNdÆùH©¸* binitially zero. Other disk drivers should initialize the dqFSID field to either the file system ID°dONLNd©HµÎ* [number of the file system that formatted the disk, or to fsmGenericFSID ($ffff) if the file°dONLNdmµH¡Ã* system cannot be identified.(ÚH3-)
  3528. 14)&%Macintosh File System Data Structuresˇ8dˇ ˇˇˇˇd
  3529. d,Times
  3530. .(3Ä The File System Utility Routines,     Helvetica
  3531. °dONLNds`Çã(~` FILE SYSTEM LOCATION INFORMATION l^l Ö^Ö
  3532. °dONLNd!ú`®˚*'XA file system must be able to determine the file, directory, or volume using information°dONLNdz®`¥* `passed to it in a parameter block. This section tells how to use File System Utility routines to°dONLNd€¥`¿
  3533. * [make that determination. The section titled “HFS Specifications” in Inside Macintosh: Files°dONLNd7¿`Ãp* =lists the various ways files or directories can be specified.
  3534. °dONLNdu‰`ÛX*&About Volume Reference Numbers Û^Û
  3535. °dONLNdî` 
  3536. *TEach volume is given a unique volume reference number when the volume is mounted and°dONLNdÈ `* Mthe volume’s VCB is added to the VCB queue by UTAddNewVCB. A volume reference°dONLNd7`$* Ynumber is only valid for a particular volume while that volume is mounted. If a volume is°dONLNdë$`0* Wunmounted and then mounted again, a new volume reference number will be assigned to the°dONLNdÈ0`<á* volume.
  3537. °dONLNdÒT`c)*&About Directory ID Numbers c^c
  3538. °dONLNd p`|˛*ZA foreign file system must be able to assign a directory ID number to all directories on a°dONLNdg|`à* Yvolume. Each directory ID must be unique and cannot be used as a file number for the same°dONLNd¡à`î* ^volume. For directories other than the root directory (which must be fsRtDirID), the directory°dONLNd î`†* %ID must be fsUsrCNID (16) or greater.°dONLNdF¨`∏*YWhile a volume is mounted, directory IDs must remain the same. Directory IDs must be kept°dONLNd†∏`ƒ˛* Rthe same while a volume is unmounted. Macintosh programs and the Alias Manager use°dONLNdÛƒ`–º* Hdirectory IDs to locate directories on the volume between volume mounts.
  3539. °dONLNd<Ë`˜Ó*&About File Numbers ˜^˜
  3540. °dONLNdO`˛*[A foreign file system must be able to assign a file number to all files on a volume. A file°dONLNd´`* Xnumber is never passed as a parameter to a file system routine. Each file number must be°dONLNd`(* Yunique and cannot be used as a directory ID number for the same volume.  File numbers for°dONLNd^(`4* Wfiles opened by programs using File Manager requests must be fsUsrCNID (16) or greater.°dONLNd∂4`@* \File numbers less than fsUsrCNID are reserved for the root directory ID and for files opened°dONLNd@`L* _by file systems for their own internal use (for example, the catalog and extents overflow files°dONLNdsL`X* Wused by the HFS file system). The File Manager’s UnmountVol code returns fBsyErr to the°dONLNdÀX`d* acaller and will not call your foreign file system if there are open files on the specified volume°dONLNd-d`p¸* Xwith file numbers fsUsrCNID or greater. If your foreign file system open files with file°dONLNdÜp`|* \numbers less than fsUsrCNID, your foreign file system is responsible for closing those files°dONLNd„|`àÏ* before unmounting a volume.°dONLNdˇî`†
  3541. *XWhile a volume is mounted, file numbers must remain the same. File numbers should, if at°dONLNd    X†`¨|* ;all possible, be kept the same while a volume is unmounted.+ÌI File System Location Information)∏3-)
  3542. 15ˇ¥dˇ ˇˇˇˇd
  3543. d,Times
  3544. .+H3 Guide to the File System Manager°dONLNdUHaÒ*+]A foreign file system will use a file number in the file control block (FCB) of an open file.°dONLNd^aHmÚ* [The file number can be used to find a FCB, and is used to identify multiple access paths to°dONLNd∫mHyÓ* Tthe same file by the UTAdjustEOF and UTCheckPermission File System Utility routines.,     Helvetica
  3545. °dONLNdëH†¸*&About File ID References †F†
  3546. °dONLNd(≠Hπı*]File ID references are an optional file system feature that allow the Alias Manager and other°dONLNdÜπH≈* Zprograms to track files that have been moved or renamed within a volume. If a foreign file°dONLNd·≈H—Î* Zsystem supports file ID references on its volumes, the foreign file system must be able to°dONLNd<—H›˛* cassign a file ID reference to a file, and later return that file’s location and name given only the°dONLNd†›HÈê* Efile ID reference number, even if the file has been moved or renamed.°dONLNdÊıHÙ*VFile ID reference numbers must be kept the same while a volume is unmounted. Macintosh°dONLNd=H
  3547. ˆ* Zprograms and the Alias Manager use file ID reference numbers to locate files on the volume°dONLNdò
  3548. Hø* between volume mounts.
  3549. °dONLNdØ1H@ı*&Determining the Volume @F@
  3550. °dONLNdΔMHYˇ*]Before a foreign file system is called, the Macintosh file system and the File System Manager°dONLNd$YHe˛* \have determined what volume is the target of the call and what file system owns that volume.°dONLNdÅeHqÿ* UThe volume is identified by the volume control block parameter passed to foreign file°dONLNd◊qH}Ô* Ssystem’s HFSCIProc. UTDetermineVol can also be used to determine what volume is the°dONLNd+}Hâé* target of a call.°dONLNd=ïH°‡*OTwo file system calls are exceptions: _MountVol and _VolumeMount. _MountVol and°dONLNdç°H≠˘* T_VolumeMount both deal with unmounted volumes (or potentially unmounted volumes), so°dONLNd‚≠HπÒ* Wthe volume control block parameter passed to foreign file system’s HFSCIProc is unused.
  3551. °dONLNd;—H‡u*&*Determining the File or Directory Location ‡F‡
  3552. °dONLNdfÌH˘ˇ*`A file’s location can be given in a file system call by full pathname, or by partial pathname. A°dONLNd«˘H„* Xdirectory’s location can be given by full pathname, partial pathname, or directory ID. A°dONLNd H”* Uforeign file system must determine the directory ID the pathname starts in before the°dONLNdvH˚* [pathname to a file or directory can be parsed. Listing 3-2, GetCurrentDir, shows how to use°dONLNd“H)Ô* \the contents of the call’s parameter block and File System Utility routines to determine the°dONLNd/)H5ˆ* [directory parsing should begin in. The dirID input parameter contains the directory ID from°dONLNdã5HAÓ* _the parameter block if that field is valid for the request recieved. Not all requests include a°dONLNdÎAHM˚* ]directory ID specification. For example, the old file system calls like PBOpen do not include°dONLNd    IMHY’* Ta directory ID specification. GetCurrentDir returns a pointer to the volume’s VCB in°dONLNd    ûYHe* ZvolCtrlBlockPtr, the directory where parsing should begin is returned in currentDirectory,°dONLNd    ˘eHqÄ* Band the method used to determine the volume is returned in status.°dONLNd
  3553. <}ââÕ+A Listing 3-2.°dONLNd
  3554. H}Õâ¿)D2  Determining where directory parsing should start,
  3555. Courier
  3556. °dONLNd
  3557. {íHûf(õHOSErr°dONLNd
  3558. ÅílûÚ)$AGetCurrentDir(ParmBlkPtr pb, long dirID, VCBPtr *volCtrlBlockPtr,°dONLNd
  3559.  ûΔ™™+Z &long *currentDirectory, short *status)°dONLNd
  3560. Ò™H∂N(≥H{°dONLNd
  3561. Ù∂Z¬x+ OSErr°dONLNd
  3562. ¸∂¢¬Ã)Hresult;°dONLNd ¬ZŒx(ÀZshort°dONLNd
  3563. ¬¢ŒÍ)H moreMatches;
  3564. (ÚH3-)
  3565. 16)& File System Location Informationˇ dˇ ˇˇˇˇd
  3566. d,Times
  3567. .(3Ä The File System Utility Routines,
  3568. Courier
  3569. °dONLNdUraê(^rshort°dONLNdU∫aÍ)HvRefNum;°dONLNdarmÆ(jr
  3570. WDCBRecPtr°dONLNda∫m)HwdCtrlBlockPtr;°dONLNd.mryú(vrWDPBRec°dONLNd7m∫yÿ)Hwdpb;°dONLNd@Örë‘(ér;result = UTDetermineVol(pb, status, &moreMatches, &vRefNum,°dONLNdÜëùh+ê volCtrlBlockPtr);°dONLNdôùr©Í(¶rif (result == noErr)°dONLNdØ©rµx* {°dONLNd≥µÑ¡‰+ switch (*status)°dONLNdΔ¡ÑÕä* {°dONLNdÀÕñŸ\+ !/* Determined by full pathname */°dONLNdŸñÂ* case dtmvFullPathame:°dONLNd
  3571. ®Ò‡+ 4/* Current directory is always the root directory */°dONLNdCÒ®˝\* *currentDirectory = fsRtDirID;°dONLNdf˝®    Ã* break;°dONLNdtñ!Œ(ñ4/* Determined by volume refNum or by drive number */°dONLNd¨!ñ-¸* case dtmvVRefNum:°dONLNd¡-ñ9* case dtmvDriveNum:°dONLNdÿ9®Eº+ ./* Current directory is dirID if specified; */°dONLNd E®Qò* (/* otherwise, it's the root directory */°dONLNd8Q®]* if (dirID != 0)°dONLNdM]∫iV+ *currentDirectory = dirID;°dONLNdli®u¿(r®else°dONLNdvu∫Ån+ *currentDirectory = fsRtDirID;°dONLNdôÅ®çÃ(ä®break;°dONLNdßôñ•û(¢ñ,/* Determined by working directory refNum */°dONLNd◊•ñ±* case dtmvWDRefNum:°dONLNdÓ±®Ωº+ ./* Current directory is dirID if specified; */°dONLNd!Ω®…û* )/* otherwise, it's wdDirID in the WDCB */°dONLNdO…®’* if (dirID != 0)°dONLNdd’∫·V+ *currentDirectory = dirID;°dONLNdÉ·®Ì¿(Í®else°dONLNdåÌ®˘Æ* {°dONLNdì˘∫¯+ 5result = UTResolveWDCB(0, 0, pb->fileParam.ioVRefNum,°dONLNd◊J∞+ê &wdCtrlBlockPtr);°dONLNdÓ∫2(∫if (result == noErr)°dONLNd    Ã)‘+ ,*currentDirectory = wdCtrlBlockPtr->wdDirID;°dONLNd:)®5Æ(2®}°dONLNd@5®AÃ* break;°dONLNdNMñYb(Vñ"/* Determined by default volume */°dONLNdtYñe¸* case dtmvDefault:°dONLNdäe®qº+ ./* Current directory is dirID if specified; */°dONLNdΩq®}™* +/* otherwise, it's the default directory */°dONLNdÌ}®â* if (dirID != 0)°dONLNdâ∫ïV+ *currentDirectory = dirID;°dONLNd!ï®°¿(û®else°dONLNd*°®≠Æ* {°dONLNd1≠∫π⁄+ 0wdpb.ioNamePtr = NULL; /* the name not needed */°dONLNdgπ∫≈z*  result = UTGetDefaultVol(&wdpb);°dONLNdç≈∫—2* if (result == noErr)
  3572. +ì$ File System Location Information)∏3-)
  3573. 17ˇ
  3574. jdˇ ˇˇˇˇd
  3575. d,Times
  3576. .+H3 Guide to the File System Manager,
  3577. Courier
  3578. °dONLNdU¥aÜ+l+#*currentDirectory = wdpb.ioWDDirID;°dONLNd(aêmñ(jê}°dONLNd.mêy¥* break;°dONLNd<Ö~ëb(é~&/* This should never happen, but... */°dONLNdfë~ùÆ* default:°dONLNdsù꩸+ result = paramErr;°dONLNdä©êµ¥* break;°dONLNdìµl¡r(æl}°dONLNdñ¡ZÕ`( Z}°dONLNdôÕZŸ∫* return (result);°dONLNd™ŸHÂN(‚H}
  3579. °dONLNd¨¯HÛ*YOnce the directory ID where parsing will begin has been determined, the pathname (if any)°dONLNdHˆ* \must be parsed to find the object. The process of parsing a pathname consists of getting the°dONLNdcH˙* Wnext component in a pathname and determining where that component is on the volume, and°dONLNdªH(˝* ^then repeating those two steps until the end of the pathname is reached. Parsing can go either°dONLNd(H4˝* ]up or down in a volume’s directory heirarchy so a foreign file system must be able to find an°dONLNdx4H@˜* Zobject by name within a specified directory to move down in the heirarchy and must be able°dONLNd”@HLÔ* Zto find an object’s parent directory to move up in the heirarchy. Listing 3-3 shows how to°dONLNd.LHXÔ* Zparse a pathname. How a foreign file system finds an object on a volume is specific to the°dONLNdâXHd§* foreign file system.°dONLNdûpœ|+á Listing 3-3.°dONLNd™p|{)D  Parsing a pathname
  3580. °dONLNdøÖHëÃ(éHstruct ObjectInfoRec {°dONLNd◊ëZùr+ long°dONLNd›ëêùÿ)6 parentDirID;°dONLNdÍëÍù¬)Z$/* the directory ID of the parent */°dONLNdùZ©x(¶ZStr31°dONLNdùê©Ã)6
  3581. localName;°dONLNd#ùÍ©Ê)Z*/* the local name within said directory */°dONLNdO©ZµÑ(≤ZBoolean°dONLNdW©êµ∫)6exists;°dONLNda©Íµ§)Z/* TRUE if the object exists */°dONLNdǵZ¡Ñ(æZBoolean°dONLNdäµê¡¥)6isDir;°dONLNdìµÍ¡‘)Z'/* TRUE if the object is a directory */°dONLNdº¡ZÕr( Zlong°dONLNd¬¡êÕfi)6
  3582. objectNumber;°dONLNd–¡ÍÕÏ)Z+/* directory ID or file number of object */°dONLNd¸ÕHŸT(÷H};°dONLNdˇŸHÂJ* +typedef struct ObjectInfoRec ObjectInfoRec;°dONLNd+ÂHÒ8* (typedef ObjectInfoRec *ObjectInfoRecPtr;°dONLNdU˝H    Í*OSErr ParsePathName (VCBPtr°dONLNdq˝¸    ∞)¥theVCB, long currentDirectory,°dONLNdò    Δ‡(Δ/StringPtr namePtr, ObjectInfoRecPtr objectInfo)°dONLNd»H!N(H{°dONLNdÀ!Z-x+ OSErr°dONLNd”!¢-Ã)Hresult;°dONLNd‹-Z9¢(6Z ParsePathRec°dONLNdÈ-¥9Í)Z    parseRec;°dONLNdÙ9ZEx(BZStr31°dONLNd¸9¢Eˆ)HlastComponent;°dONLNdQZ]¬(ZZ</* init parseRec to start parsing at beginning of namePtr */°dONLNdL]Zi¸* parseRec.namePtr = namePtr;°dONLNdiiZu* parseRec.startOffset = 0;°dONLNdÑuZÅ* parseRec.ComponentLength = 0;°dONLNd£ÅZçˆ* parseRec.moreName = false;°dONLNdøçZô*  parseRec.foundDelimiter = false;
  3583. (ÚH3-)
  3584. 18)& File System Location Informationˇ&dˇ ˇˇˇˇd
  3585. d,Times
  3586. .(3Ä The File System Utility Routines,
  3587. Courier
  3588. °dONLNdUra˛(^rB/* Get the length of the volume name (if any) and use it to adjust°dONLNdEarm* E** the startOffset to point to the beginning of the partial pathname.°dONLNdçmry
  3589. * D** UTParsePathname also ensures the pathname is not NULL or an empty°dONLNd‘yrÖÆ*
  3590. ** string.°dONLNd‡Örë~* */°dONLNd‰ërù˛* Bresult = UTParsePathname(&parseRec.startOffset, parseRec.namePtr);°dONLNd(ùr©Í* if (result == noErr)°dONLNd>©rµx* {°dONLNdBµÑ¡ê+ /*°dONLNdEµñ¡»)3At this point, startOffset is pointing at the first°dONLNd|¡ÑÕê( Ñ**°dONLNd¡ñÕ⁄)6character of a partial pathname (if any). For example:°dONLNd∏ÕÑŸJ(÷Ñ!**      namePtr = 'VolName:a:b:c'°dONLNd⁄Õ\Ÿ∂)ÿ(full pathname)°dONLNdÏŸÑÂ&(‚Ñ**  startOffset =         ^°dONLNd
  3591. ÂÑÒ * **      namePtr = ':a:b:c'°dONLNd(Â\Ò»)ÿ(partial pathname)°dONLNd=ÒÑ˝¸(˙Ñ**  startOffset =  ^°dONLNdT˝Ñ    * **      namePtr = 'a'°dONLNdn˝\    »)ÿ(partial pathname)°dONLNdÉ    Ñ¸(Ñ**  startOffset =  ^°dONLNdöÑ!,* **      namePtr = 'VolName:'°dONLNdπ\!∂)ÿ(full pathname)°dONLNdÀ!Ñ-&(*Ñ**  startOffset =         ^°dONLNdÈ-Ñ9ê* */°dONLNdÒEÑQ⁄*9/* Check for leading delimiter of the partial pathname */°dONLNd-QÑ]Ü* +result = UTGetPathComponentName(&parseRec);°dONLNd[]Ñi¸* if (result == noErr)°dONLNdriÑuä* {°dONLNdwuñÅ+ =if (parseRec.ComponentLength == 0 && parseRec.foundDelimiter)°dONLNd∏Åñçú* {°dONLNdæç®ôh+  /* Get past initial delimiter */°dONLNd„ô®•2* ++parseRec.startOffset;°dONLNd˛•ñ±ú(Æñ}°dONLNdΩñ…⁄*6/* At this point, startOffset is pointing at the first°dONLNdB…ñ’¬* 2** character of the first component name (if any).°dONLNdy’ñ·* ** For example:°dONLNdå·ñÌb* "**      namePtr = 'VolName:a:b:c' °dONLNdØ·nÌ»)ÿ(full pathname)°dONLNd¬Ìñ˘>(ˆñ**  startOffset =          ^°dONLNd·Ìn˘‘)ÿ(moreName = true,°dONLNdˆ˘ñ¢(ñ**°dONLNd˘nÏ)ÿ componentLength = 0)°dONLNdñ⁄(ñ6**      namePtr = ':a:b:c'          (partial pathname)°dONLNdWñ‘* 5**  startOffset =   ^               (moreName = true,°dONLNdêñ)¢* **°dONLNdûn)Ï)ÿ componentLength = 0)°dONLNd∑)ñ5⁄(2ñ6**      namePtr = 'a'               (partial pathname)°dONLNdÒ5ñA‘* 5**  startOffset =  ^                (moreName = true,°dONLNd*AñM¢* **°dONLNd8AnMÏ)ÿ componentLength = 0)°dONLNdQMñY»(Vñ3**      namePtr = 'VolName:'        (full pathname)°dONLNdàYñe⁄* 6**  startOffset =          ^        (moreName = false,°dONLNd¬eñq¢* **°dONLNd–enqÏ)ÿ componentLength = 0)°dONLNdÈqñ}¢(zñ*/°dONLNdÛâñï‘*5/* Parse until there is no more pathname to parse. */°dONLNd,ïñ°™* .while ((result == noErr) && parseRec.moreName)°dONLNd^°ñ≠ú* {°dONLNdd≠®πÊ+ 5/* Search for the next delimiter from startOffset. */°dONLNdûπ®≈™* +result = UTGetPathComponentName(&parseRec);
  3592. +•0 File System Location Information)∏3-)
  3593. 19ˇ
  3594. “dˇ ˇˇˇˇd
  3595. d,Times
  3596. .+H3 Guide to the File System Manager,
  3597. Courier
  3598. °dONLNdUêa+H+if (result == noErr)°dONLNdaêmñ* {°dONLNd m¢yn+ "if (parseRec.ComponentLength == 0)°dONLNdHy¢Ö®* {°dONLNdPÖ¥ë¯+ 6/* A delimiter was found immediately following another°dONLNdéë¥ù‘* 0** delimiter. Set current directory to parent of°dONLNdΔù¥©¬* -** current directory. If current directory is°dONLNd˚©¥µÏ* 4** fsRtDirID, then return bdNamErr (that handles the°dONLNd7µ¥¡»* .** case of 'Root::' or 'Root:SubDir:::', etc.)°dONLNdl¡¥Õ¿* */°dONLNduÕ¥ŸÄ* "if (currentDirectory != fsRtDirID)°dONLNdûŸ¥Â∫* {°dONLNdßÂΔÒÊ+ 0/* Call foreign file system specific code to get°dONLNd‡ÒΔ˝z* ** parent of current directory°dONLNd˝Δ    “* */°dONLNd    Δ‡* /result = FFSGetParent(theVCB, currentDirectory,°dONLNdPV!»+ê ¤tDirectory);°dONLNdj!¥-∫(*¥}°dONLNdr-¥9Ã* else°dONLNd}9¥E∫* {°dONLNdÜEΔQÏ+ 1/* Pathname tried to go up from root directory */°dONLNdøQΔ]2* result = bdNamErr;°dONLNdÿ]¥i∫(f¥}°dONLNdÁu¥ÅÚ*5/* startOffset = start of next component (if any). */°dONLNd#Å¥ç>* ++parseRec.startOffset;°dONLNd@ç¢ô®(ñ¢}°dONLNdGô¢•D* else if (parseRec.moreName)°dONLNdh•¢±®* {°dONLNdp±¥Ω»+ ./* A component was found and it isn't the last°dONLNd¶Ω¥…»* .** component, so it must be a directory.  Make°dONLNd‹…¥’Ú* 5** lastComponent in current directory the new current°dONLNd’¥·*
  3599. ** directory.°dONLNd-·¥Ì¿* */°dONLNd6Ì¥˘º* ,lastComponent[0] = parseRec.ComponentLength;°dONLNdi˘¥§* (BlockMove((Ptr)((long)parseRec.namePtr +°dONLNdõÿt+$ parseRec.startOffset + 1),°dONLNdæÿD* &lastComponent[1],°dONLNd⁄ÿ)t* parseRec.ComponentLength);°dONLNd˚)¥5‘(2¥0/* Call foreign file system specific code to get°dONLNd35¥A§* (** directory by name in currentDirectory°dONLNdcA¥M¿* */°dONLNdlM¥Y™* )result = FFSGetDir(theVCB, lastComponent,°dONLNd¢YeÏ+Z %currentDirectory, ¤tDirectory);°dONLNd’q¥}Ú(z¥5/* startOffset = start of next component (if any). */°dONLNd}¥âÚ* 5parseRec.startOffset += parseRec.ComponentLength + 1;°dONLNdLâ¢ï®(í¢}°dONLNdRïê°ñ(ûê}°dONLNdW°~≠Ñ(™~}
  3600. (ÚH3-)
  3601. 20)& File System Location Informationˇ ådˇ ˇˇˇˇd
  3602. d,Times
  3603. .(3Ä The File System Utility Routines,
  3604. Courier
  3605. °dONLNdUña(^ñif (result == noErr)°dONLNdañmú* {°dONLNdm®yû+ )/* There is no more pathname to parse. */°dONLNdLy®Öt* "if (parseRec.ComponentLength == 0)°dONLNdsÖ®ëÆ* {°dONLNdzë∫ùÏ+ 3/* The pathname ended with '::' or the pathname was°dONLNd¥ù∫©⁄* 0** simply a volume name ('VolName:'), so current°dONLNdΩ∫µ\* ** directory is the object.°dONLNd
  3606. µ∫¡Δ* */°dONLNd¡∫ÕP* objectInfo->isDir = true;°dONLNd4Õ∫Ÿ¬* ,objectInfo->objectNumber = currentDirectory;°dONLNdfŸ∫Â⁄* 0/* Call foreign file system specific code to get°dONLNdùÂ∫Òz*  ** information on this directory°dONLNdƒÒ∫˝Δ* */°dONLNdÃ˝∫    º* +result = FFSGetDirInfo(theVCB, objectInfo);°dONLNd¸    ®Æ(®}°dONLNd®!¿* else°dONLNd !®-Æ* {°dONLNd-∫9
  3607. + 8/* The pathname ended with 'name:' or 'name', so name is°dONLNdQ9∫E* ** the object.°dONLNdfE∫QΔ* */°dONLNdnQ∫]Ú* 4objectInfo->localName[0] = parseRec.ComponentLength;°dONLNd®]∫i™* (BlockMove((Ptr)((long)parseRec.namePtr +°dONLNdŸifiuz+$ parseRec.startOffset + 1),°dONLNd˙uÃÅt(~Ã&(objectInfo->localName[1]),°dONLNdÅÃçh* parseRec.ComponentLength);°dONLNd?ô∫•º(¢∫+objectInfo->parentDirID = currentDirectory;°dONLNdp•∫±⁄* 0/* Call foreign file system specific code to get°dONLNdß±∫Ω\* ** information on this file°dONLNd…Ω∫…Δ* */°dONLNd—…∫’™* (result = FFSGetFile(theVCB, objectInfo);°dONLNd˛’®·Æ(fi®}°dONLNd·ñÌú(Íñ}°dONLNdÌÑ˘ä(ˆÑ}°dONLNd
  3608. ˘rx(r}°dONLNd
  3609. rä* else°dONLNdrx* {°dONLNdÑ)+ result = bdNamErr;°dONLNd*)
  3610. )~,/* Default to bad name (if ioNamePtr != NULL°dONLNda)5¯* )** or ioNamePtr doesn't point to an empty°dONLNdï5A
  3611. * ,** string). Otherwise, the code that follows°dONLNdÃAMº* ** will set up the real result.°dONLNdˆMY* */°dONLNd˚YÑeÜ(bÑ+if ((namePtr == NULL) || (namePtr[0] == 0))°dONLNd)eÑqä* {°dONLNd.qñ}¯+ ;/* pathname was NULL or a zero length string, so we found a°dONLNdn}ñât* %** directory at the end of the string°dONLNdòâñï¢* */°dONLNdûïñ°,* objectInfo->isDir = true;°dONLNdª°ñ≠û* ,objectInfo->objectNumber = currentDirectory;°dONLNdÎ≠ñπ* ?/* Call foreign file system specific code to get information on°dONLNd/πñ≈¸* ** this directory°dONLNdE≈ñ—¢* */
  3612. +∑$ File System Location Information)∏3-)
  3613. 21ˇ†dˇ ˇˇˇˇd
  3614. d,Times
  3615. .+H3 Guide to the File System Manager,
  3616. Courier
  3617. °dONLNdU~aÄ+6++result = FFSGetDirInfo(theVCB, objectInfo);°dONLNd.almr(jl}°dONLNd1mZy`(vZ}°dONLNd4yZÖ∫* return (result);°dONLNdEÖHëN(éH}
  3618. (ÚH3-)
  3619. 22)& File System Location Informationˇ
  3620. Ndˇ ˇˇˇˇd
  3621. d,Times
  3622. .(3Ä The File System Utility Routines,     Helvetica
  3623. °dONLNds`Ç^(~`THE MACINTOSH VOLUME CACHE l^l Ö^Ö
  3624. °dONLNdú`®*'ZThe Macintosh operating system uses a volume (disk) cache for input and output operations.°dONLNdv®`¥È* RThe following sections provide both general information about caching and specific°dONLNd…¥`¿Ã* Jinformation about the volume cache used by the Macintosh operating system.
  3625. °dONLNdÿ`Á_*& About the Macintosh Volume Cache Á^Á
  3626. °dONLNd5Ù`*UThe Macintosh operating system allows users to set aside memory for a general-purpose°dONLNdã` * Xvolume cache. A volume cache is an area in memory that is used to store blocks that have°dONLNd‰ `* [been recently read from or written to a volume. By keeping blocks in memory that are likely°dONLNd@`$
  3627. * ]to be read or written again, a file system can avoid repeating I/O operations to the volume’s°dONLNdû$`0* adevice and, as a result, can save a great deal of time. Use of the cache can greatly increase the°dONLNd0`< * Zspeed of many applications. The one disadvantage is that memory set aside for the cache is°dONLNd[<`H‡* unavailable to applications.
  3628. °dONLNdxZ`i3* How Users Control the Cache
  3629. °dONLNdît`Ä*VThe Memory control panel allows users to change the amount of memory set aside for the°dONLNdÎÄ`å * Xcache. The Memory control panel allows users to reclaim some, but not all, of the memory°dONLNdDå`ò* !used by the cache when necessary.°dONLNdf§`∞*_Although a foreign file system cannot determine the size of the cache, there is always at least°dONLNdΔ∞`º„* 32K set aside for the cache.
  3630. °dONLNd„Œ`›i* "The Cache and Foreign File Systems
  3631. °dONLNdË`Ù*^A foreign file system can gain access to the cache by using the cache routines provided by the°dONLNdeÙ`‰* SFile System Manager. Foreign file system’s should try to use these routines for all°dONLNdπ` * [input/output operations. There are a number of reasons why a foreign file system should use°dONLNd `x* ?the cache routines instead of calling a device driver directly:°dONLNdU$l0p+ •°dONLNdW$y0
  3632. )
  3633. TIncreased throughput:  By reducing the number of input/output operations, use of the°dONLNd¨0y<F* +cache can dramatically increase throughput.°dONLNdÿHlTp(Ql•°dONLNd⁄HyT)
  3634. WUsers can control the cache:  The Control Panel lets users control the amount of memory°dONLNd2Ty`›* set aside for caching.°dONLNdIllxp(ul•°dONLNdKlyx)
  3635. YEasier implementation:  The foreign file system does not have to allocate a buffer for an°dONLNd•xyÑã* <entire block when only part of a block is to be transferred.°dONLNd‚êlúp(ôl•°dONLNd‰êyúÚ)
  3636. OSupport for both logical and physical blocks:  The Macintosh cache routines can°dONLNd4úy® * Vperform operations involving physical blocks on a volume or logical blocks for a file.+ÂMThe Macintosh Volume Cache)ß3-)
  3637. 23ˇJdˇ ˇˇˇˇd
  3638. d,Times
  3639. .+H3 Guide to the File System Manager°dONLNdaTmX+ 7•°dONLNdaamÂ)
  3640. RAsynchronous execution:  All cache routines that transfer data to or from a volume°dONLNdUmayÒ* Rexecute asynchronously. This means that control can be returned from the Macintosh°dONLNd®yaÖ* [file system to the caller before an input or output operation is complete. (Although to the°dONLNdÖaë÷* Sforeign file system it appears that the cache routine waits until the operation has°dONLNdXëaùÛ* Vcompleted, the Macintosh file system returns control to the caller—unless the original°dONLNdØùa©Í* Qtrap was requested to be run synchronously—while waiting for the I/O operation to°dONLNd©aµ¸* Xfinish. When the I/O operation is complete, the Macintosh file system returns control to°dONLNdZµa¡ˆ* Wthe foreign file system in such a way that normal completion of the foreign file system°dONLNd≤¡aÕ * Mroutine will allow execution of the application’s code to resume where it was°dONLNdÕaŸú*
  3641. interrupted.),
  3642.  
  3643. Zapf Dingbats
  3644. °dONLNdÂTÒ_(ÔTs°dONLNdÊfÚö)Warning:°dONLNdÊöÚ‡)4I  It is important to note the use of the cache routines is the only way a°dONLNdbÚf˛„(˚fRforeign file system can perform asynchronous I/O. If a foreign file system calls a°dONLNdµ˛f
  3645. fl* Rdevice driver directly, all I/O operations are executed synchronously, even if the°dONLNd
  3646. f„* Rcalling application has requested asynchronous I/O. If your foreign file system is°dONLNd[f"Ë* Vcalled at interrupt time and the device driver (or another device driver called by the°dONLNd≤"f.º* Ldevice driver) is busy, calling the device driver directly will deadlock the°dONLNdˇ.f:œ* MMacintosh system. For this reason, all calls to most device drivers should be°dONLNdM:fF* !made through the cache routines. 
  3647.     °dONLNdn<E
  3648. )üs,     Helvetica
  3649. °dONLNdp^Hm©(iH Cache Blocks
  3650. °dONLNd}xHÑ˝*^Each cache block is made up of header information that identifies the volume and file (if any)°dONLNd‹ÑHêˆ* \from which the data was taken and an offset that identifies how far, in bytes, the block was°dONLNd9êHúÙ* ]from the beginning of the volume (for volume I/O) or the beginning of the file (for file I/O)°dONLNdóúH®* [and 512 bytes of data. The structure of cache block headers and where they reside in memory°dONLNdÛ®H¥˜* [is undefined. Cache routines that work with individual cache blocks always use a pointer to°dONLNdO¥H¿≥* the cache block’s data.°dONLNdgÃHÿ|*?The Macintosh volume cache has four categories of cache blocks:°dONLNd߉TX+ •°dONLNd©‰aï)
  3651. Reserved°dONLNd±‰ïÎ)4J cache blocks - A cache block that is in use is reserved. A reserved cache°dONLNd¸a¸˙(˘aYblock corresponds to a logical block of a file or a physical block of a volume and is not°dONLNdV¸aÿ* Navailable for reuse. A cache block is reserved with the UTGetBlock function. A°dONLNd•aÛ* Zreserved cache block can contain clean or dirty data (or no valid data at all if the cache°dONLNd    a Ë* Rblock was obtained for use as a write buffer). Cache blocks should not be reserved°dONLNd    S a,Ó* between calls to a file system.°dONLNd    s8TDX(AT•°dONLNd    u8aDì)
  3652. Released°dONLNd    }8ìD˚)2O cache blocks - A cache block that is very likley to be needed again but is not°dONLNd    ÕDaPı(MaWreserved should be released. A released cache block still corresponds to a block of the°dONLNd
  3653. %Pa\Ô* Wfile or volume, but is available for reuse. A released cache block can contain clean or°dONLNd
  3654. }\ahë* dirty data.°dONLNd
  3655. âtTÄX(}T•°dONLNd
  3656. ãtaÄz)
  3657. Free°dONLNd
  3658. ètzÄÙ)Q cache blocks - A cache block that isn’t likley to be used again should be marked°dONLNd
  3659. ·ÄaåŒ(âaSfree. A free cache block still contains valid data and is still associated with the°dONLNd 5åaò‚* Qcorresponding block of the volume, but not with a file on the volume. Dirty cache°dONLNd áòa§Ò* Sblocks should be flushed before marking them free. Free cache blocks will be reused°dONLNd €§a∞Î* before released cache blocks.(ÚH3-)
  3660. 24)&The Macintosh Volume CacheˇJdˇ ˇˇˇˇd
  3661. d,Times
  3662. .(3Ä The File System Utility Routines°dONLNdalmp(jl•°dONLNdaym¶)
  3663. Trashed°dONLNd    a¶m)-N cache blocks - A cache block that will never be used again should be trashed.°dONLNdXmyyˇ(vyPTrashing a cache block marks the cache block empty. Dirty cache blocks should be°dONLNd©yyÖ* Tflushed before trashing them. Trashed cache blocks will be reused before released or°dONLNd˛ÖyëŒ* free cache blocks.°dONLNdù`©ø(¶`JAs mentioned above, a cache block can be dirty or clean. A cache block is °dONLNd[ùø©⁄(¶ødirty°dONLNd`ù⁄©)     when its°dONLNdj©`µ(≤`Zcontents do not match the contents of the corresponding block on the volume. To update the°dONLNd≈µ`¡
  3664. * $volume, a dirty cache block must be °dONLNdȵ
  3665. ¡7)≠flushed°dONLNdµ7¡)*1 by writing its contents out to the volume.  This°dONLNd"¡`ÕÏ( `occurs in the following cases:°dONLNdAŸlÂp+ •°dONLNdCŸy²)
  3666. SThe Macintosh operating system replaces a released cache block that is dirty with a°dONLNdóÂyÒ* Tblock from the volume that is being read into the cache. When this occurs, the dirty°dONLNdÏÒy˝D* -cache block is flushed before it is replaced.°dONLNd    lp(l•°dONLNd    yˆ)
  3667. RThe foreign file system flushes the dirty cache block in response to a _FlushFile,°dONLNdoy!˜* _Close, or _FlushVol call.°dONLNdä-l9p(6l•°dONLNdå-y9)
  3668. SThe foreign file system flushes a cache block at some other time (for example, when°dONLNd‡9yEË* handling a _Write call).°dONLNd˘Q`]    (Z`WWhen using the cache routines, remember that any cache operation may force a previously°dONLNdQ]`i* [cached block to be removed from memory. If there are no trashed or free cache blocks, a new°dONLNd≠i`u* ]block that is read into the cache from the volume replaces the contents of the least recently°dONLNd u`ÅC* 2used of the released blocks (if any) in the cache.,     Helvetica
  3669. °dONLNd>ì`¢S* !Logical to Physical Block Mapping
  3670. °dONLNd`≠`π˝*ZThe Macintosh cache routines can read or write either logical blocks of a file or physical°dONLNdªπ`≈* [blocks of a volume. However, because disk driver device calls always read or write physical°dONLNd≈`—* ^blocks of a volume, a foreign file system must provide a routine to map logical file blocks to°dONLNdv—`›* \physical volume blocks called the logical to physical routine. The address of the logical to°dONLNd”›`È* [physical routine is passed to the File System Manager in the foreign file system’s HFSCIRec°dONLNd/È`ı* ^and as a parameter to some cache routines. The interface for the logical to physical routine a°dONLNdéı` * UFSM-based foreign file system must supply is defined in “The HFS Component Interface”°dONLNd‰`
  3671. Ü* chapter.°dONLNdÌ`%*bIt is the responsibility of the foreign file system to return an eofErr when a request for data is°dONLNdP%`1* cbeyond the current logical end of file. It is the responsibility of the logical to physical routine°dONLNd¥1`=* Xto return an eofErr error when a cache routine asks for block mapping beyond the current°dONLNd    
  3672. =`Iæ* physical end of file.+˛¨The Macintosh Volume Cache)ß3-)
  3673. 25ˇ hdˇ ˇˇˇˇd
  3674. d,Times
  3675. .+H2 Guide to the File System Manager,     Helvetica
  3676. °dONLNdsHÇA*LFILE SYSTEM UTILITY ROUTINES lFl ÖFÖ°dONLNd®H∑∂*5
  3677. UTAllocateFCB ∑F∑å
  3678. °dONLNd+ƒH–*YUse the UTAllocateFCB function to allocate a FCBRec in the FCB array when opening a file.,
  3679. Courier
  3680. °dONLNdÖ›HÈV*-pascal OSErr UTAllocateFCB(short *fileRefNum,°dONLNdªÈ˝ı´+µ FCBRecPtr *fileCtrlBlockPtr);
  3681. °dONLNdŸH Ä(    H
  3682. fileRefNum°dONLNd‰¥ ˛)lFContains a pointer to a short. UTAllocateFCB places the file reference°dONLNd+ ¥„* Anumber of the allocated FCBRec into the field referred to by this°dONLNdm¥$Ê*
  3683. parameter.°dONLNdx,H8ì(5HfileCtrlBlockPtr°dONLNdâ,¥8¯)lAContains a pointer to a FCBRecPtr. UTAllocateFCB places a pointer°dONLNdÀ8¥D* Eto the allocated FCBRec into the field referred to by this parameter.°dONLNdVHb˝(_HYIf an FCBRec can be allocated in the FCB array, the FCB will be marked in use (fcbFlNm is°dONLNdkbHn„* Zset to -1), the file reference number will be returned in fileRefNum, and a pointer to the°dONLNdΔnHz* ^allocated FCBRec will be returned in fileCtrlBlockPtr. The allocated FCBRec is not initialized°dONLNd%zHÜ“* Xin any way. It is up to your foreign file system to initialize all fields in the FCBRec.°dONLNd~íHû„*VIf an FCB cannot be allocated because there are no FCBRecs left in the FCB array, this°dONLNd’ûH™◊* function will return a tmfoErr.°dONLNdı∂T¬s+ Note:°dONLNd˙∂s¬„)M If your foreign file system returns the tmfoErr result from UTAllocateFCB as°dONLNdH¬TŒ›(ÀTTthe result to _Open, the Macintosh file system will attempt to enlarge the FCB array°dONLNdùŒT⁄÷* Sand if successful, will retry the _Open call.  Because enlarging the FCB array will°dONLNdÒ⁄TÊ«* Nchange the array’s location in memory, you should never save the location of a°dONLNd@ÊTÚ⁄* NFCBRec between calls to your foreign file system. A FCBRecPtr can only be used°dONLNdèÚT˛2* 0within the context of one file system operation.°dONLNd¿Hˆ(HXWhen you no longer need an allocated FCBRec (either because the file could not be opened°dONLNdH(\* :or when the file is closed), release it with UTReleaseFCB.°dONLNdT<THê+   Result codes°dONLNdaHgTÇ+ noErr°dONLNdgHˆT¸)è0°dONLNdiHTD)%No error°dONLNdrTg`å(]gtmfoErr°dONLNdzTÏ`¸)Ö-42°dONLNd~T`Ó)/*There are no free FCBRecs in the FCB array
  3684. °dONLNd©ÇHë∑(çH UTReleaseFCB ëFëå
  3685. °dONLNd∂ûH™Ë*RUse the UTReleaseFCB function to release an allocated FCBRec in the FCB array when°dONLNd    ™H∂à* closing a file.
  3686. °dONLNd√HœP*,pascal OSErr UTReleaseFCB(short fileRefNum);
  3687. *%3-)
  3688. 26)&The Macintosh Volume Cacheˇ
  3689. ‘dˇ ˇˇˇˇd
  3690. d,Times
  3691. .(2Ä The File System Utility Routines°dONLNdU`aò(^`
  3692. fileRefNum°dONLNd UÃa˜)l?Contains the file reference number that specifies the FCBRec to°dONLNdKaÃm* release.°dONLNdT`ã(à`XWhen you no longer need an allocated FCBRec (either because the file could not be opened°dONLNd≠ã`ó* Wor when the file is closed), release it with UTReleaseFCB. UTReleaseFCB will release an°dONLNdó`£†* AFCBRec in the FCB array and mark it free (the FCBRec is cleared).°dONLNdG∑l√®+   Result codes°dONLNdT√œö+ noErr°dONLNdZ√œ)è0°dONLNd\√3œ\)%No error°dONLNdeœ€¨(ÿfnOpnErr°dONLNdnœ€)Ö-38°dONLNdrœ3€é)/The file is not open°dONLNdá€ÁÆ(‰rfNumErr°dONLNdê€Á)Ö-51°dONLNdî€3Á„)/&The file reference number is not valid,     Helvetica
  3693. °dONLNdª    `≈(` UTLocateFCB ^§
  3694. °dONLNd«%`1£*?Use the UTLocateFCB function to find a FCBRec in the FCB array.,
  3695. Courier
  3696. °dONLNd>`J
  3697. *Gpascal OSErr UTLocateFCB(VCBPtr volCtrlBlockPtr, unsigned long fileNum,°dONLNdSJ®VÜ+H %StringPtr namePtr, short *fileRefNum,°dONLNd}V®bV* FCBRecPtr *fileCtrlBlockPtr);
  3698. °dONLNdõm`y´(v`volCtrlBlockPtr°dONLNd´mÃy˘)l@Contains a VCBPtr that specifies the volume the open file is on.°dONLNdÏÅ`çá(ä`fileNum°dONLNdÙÅÃç)lFContains a file number that specifies the FCBRec to search for. If you°dONLNd;çÃôˇ* Awant to find the FCBRec by file name, set this parameter to zero.°dONLNd}°`≠á(™`namePtr°dONLNdÖ°Ã≠)lJContains a pointer to a string that specifies the file name to search for.°dONLNd–≠Ãπ∞* 1This parameter is ignored if fileNum is not zero.°dONLNd¡`Õò( `
  3699. fileRefNum°dONLNd
  3700. ¡ÃÕ)lDContains a pointer to a short. UTLocateFCB places the file reference°dONLNdRÕßÓ* =number of the FCBRec found into the field referred to by this°dONLNdêŸÃ²*
  3701. parameter.°dONLNdõÌ`˘´(ˆ`fileCtrlBlockPtr°dONLNd¨ÌÃ˘)lBContains a pointer to a FCBRecPtr. UTLocateFCB places a pointer to°dONLNdÔ˘ÃÔ* >the FCBRec found into the field referred to by this parameter.°dONLNd.`#ˆ( `QUTLocateFCB will find a FCBRec in the FCB array that’s on the volume specified by°dONLNdÄ#`/* \volCtrlBlockPtr. If fileNum is not zero, UTLocateFCB will search the FCB array for the first°dONLNd›/`;* WFCBRec that has a matching file number. If fileNum is zero, UTLocateFCB will search the°dONLNd5;`G* WFCB array for the first FCBRec that has a matching file name. UTLocateFCB always starts°dONLNdçG`S„* Ssearching from the beginning of the FCB array and returns the first match it finds.°dONLNd·S`_* VUTLocateFCB returns the file reference number of the matching FCBRec in fileRefNum and°dONLNd8_`k^* 5a pointer to the matching FCBRec in fileCtrlBlockPtr.°dONLNdnlã®+   Result codes°dONLNd{ãóö+ noErr°dONLNdÅãó)è0°dONLNdÉã3ó\)%No error°dONLNdåó£ú(†fnfErr°dONLNdìó£)Ö-38°dONLNdóó3£ )/A matching FCB was not found++QThe Macintosh Volume Cache)ß3-)
  3702. 27ˇ
  3703. Ldˇ ˇˇˇˇd
  3704. d,Times
  3705. .+H2 Guide to the File System Manager,     Helvetica
  3706. °dONLNdUHdŒ*.UTLocateNextFCB dFdå
  3707. °dONLNdqH}Ù*TUse the UTLocateNextFCB function to continue seaching for a FCBRec in the FCB array.,
  3708. Courier
  3709. °dONLNdeäHñÄ*4pascal OSErr UTLocateNextFCB(VCBPtr volCtrlBlockPtr,°dONLNd¢ñ˝¢Û+µ )unsigned long fileNum, StringPtr namePtr,°dONLNd‘¢˝Æi* short *fileRefNum,°dONLNdÔÆ˝∫´* FCBRecPtr *fileCtrlBlockPtr);
  3710. °dONLNd
  3711. ≈H—ì(ŒHvolCtrlBlockPtr°dONLNd≈¥—·)l@Contains a VCBPtr that specifies the volume the open file is on.°dONLNd^ŸHÂo(‚HfileNum°dONLNdfŸ¥Â˛)lFContains a file number that specifies the FCBRec to search for. If you°dONLNd≠Â¥ÒÁ* Awant to find the FCBRec by file name, set this parameter to zero.°dONLNdÔ˘Ho(HnamePtr°dONLNd˜˘¥˝)lJContains a pointer to a string that specifies the file name to search for.°dONLNdB¥ò* 1This parameter is ignored if fileNum is not zero.°dONLNdtH%Ä("H
  3712. fileRefNum°dONLNd¥%Ì)lFContains a pointer to a short. On input, the field referred to by this°dONLNdΔ%¥1* Gparameter contains the file reference number of the last match found by°dONLNd1¥=* :UTLocateFCB or UTLocateNextFCB. On output, UTLocateNextFCB°dONLNdI=¥I* Cplaces the file reference number of the FCBRec found into the field°dONLNdçI¥U=* referred to by this parameter.°dONLNd¨]Hiì(fHfileCtrlBlockPtr°dONLNdΩ]¥i˝)lBContains a pointer to a FCBRecPtr. UTLocateFCB places a pointer to°dONLNdi¥u◊* >the FCBRec found into the field referred to by this parameter.°dONLNd?áHìı(êHUUTLocateNextFCB will find a FCBRec in the FCB array that’s on the volume specified by°dONLNdïìHü˘* XvolCtrlBlockPtr. If fileNum is not zero, UTLocateNextFCB will search the FCB array for a°dONLNdÓüH´¸* WFCBRec that has a matching file number. If fileNum is zero, UTLocateNextFCB will search°dONLNdF´H∑ˇ* Wthe FCB array for a FCBRec that has a matching file name. UTLocateNextFCB always starts°dONLNdû∑H√Í* Vsearching from the FCBRec specified by fileRefNum and returns the next match it finds.°dONLNdı√Hœ* VUTLocateNextFCB returns the file reference number of the matching FCBRec in fileRefNum°dONLNdLœH€Z* 9and a pointer to the matching FCBRec in fileCtrlBlockPtr.°dONLNdÜÔT˚ê+   Result codes°dONLNdì˚gÇ+ noErr°dONLNdô˚ˆ¸)è0°dONLNdõ˚D)%No error°dONLNd§gÑ(gfnfErr°dONLNd´Ï¸)Ö-38°dONLNdØ≤)/A matching FCB was not found
  3713. °dONLNdÃ5HD§(@H
  3714. UTIndexFCB DFDå
  3715. °dONLNd◊QH]∑*GUse the UTIndexFCB function to index through the open FCBs on a volume.
  3716. °dONLNdjHv‘*Bpascal OSErr UTIndexFCB(VCBPtr volCtrlBlockPtr, short *fileRefNum,°dONLNdhvflÇç+ó FCBRecPtr *fileCtrlBlockPtr);
  3717. °dONLNdÜçHôì(ñHvolCtrlBlockPtr°dONLNdñç¥ô·)l@Contains a VCBPtr that specifies the volume the open file is on.(ÒH3-)
  3718. 28)&The Macintosh Volume Cacheˇ
  3719. dˇ ˇˇˇˇd
  3720. d,Times
  3721. .(2Ä The File System Utility Routines°dONLNdW`cò(``
  3722. fileRefNum°dONLNd WÃc)lFContains a pointer to a short. On input, the field referred to by this°dONLNdRcÃo* Gparameter contains the file reference number of the last match found by°dONLNdöoÃ{˝* =UTIndexFCB or zero to search for the first FCBRec. On output,°dONLNdÿ{Ãá* ?UTIndexFCB places the file reference number of the FCBRec found°dONLNdáÃìì* -into the field referred to by this parameter.°dONLNdFõ`ß´(§`fileCtrlBlockPtr°dONLNdWõÃß)lAContains a pointer to a FCBRecPtr. UTIndexFCB places a pointer to°dONLNdôßÃ≥Ô* >the FCBRec found into the field referred to by this parameter.°dONLNdÿ≈`—Ú(Œ`PUTIndexFCB will find a FCBRec in the FCB array that’s on the volume specified by°dONLNd)—`›˜* PvolCtrlBlockPtr. UTIndexFCB always starts searching from the FCBRec specified by°dONLNdz›`È* SfileRefNum and returns the next FCBRec it finds on the specified volume. UTIndexFCB°dONLNdŒÈ`ı* [returns the file reference number of the matching FCBRec in fileRefNum and a pointer to the°dONLNd*ı`* $matching FCBRec in fileCtrlBlockPtr.°dONLNdOl!®+   Result codes°dONLNd\!-ö+ noErr°dONLNdb!-)è0°dONLNdd!3-\)%No error°dONLNdm-9ú(6fnfErr°dONLNdt-9)Ö-38°dONLNdx-39 )/A matching FCB was not found°dONLNdï9EÆ(BrfNumErr°dONLNdû9E)Ö-51°dONLNd¢93E„)/&The file reference number is not valid,     Helvetica
  3723. °dONLNd…g`vŒ(r` UTResolveFCB v^v§
  3724. °dONLNd÷É`è⁄*KUse the UTResolveFCB function to map a file reference number to its FCBRec.,
  3725. Courier
  3726. °dONLNd"ú`®b*+pascal OSErr UTResolveFCB(short fileRefNum,°dONLNdV®¥√+µ FCBRecPtr *fileCtrlBlockPtr);
  3727. °dONLNdtø`Àò(»`
  3728. fileRefNum°dONLNdøÃÀÊ)l;Contains a file reference number that specifies the FCBRec.°dONLNdª”`fl´(‹`fileCtrlBlockPtr°dONLNdÔÃfl)l@Contains a pointer to a FCBRecPtr. UTResolveFCB places a pointer°dONLNd
  3729. flÃÎ˚* Ato the FCBRec found into the field referred to by this parameter.°dONLNdO˝`    ‹(`LGiven a file reference number, UTResolveFCB returns a pointer to a FCBRec in°dONLNdú    `Ø* fileCtrlBlockPtr.°dONLNdÆ!`-*^If the file reference number is valid, UTResolveFCB will return noErr; even if the file is not°dONLNd
  3730. -`9
  3731. * Wopen. You can use UTCheckFileRefNum to see if a file reference number refers to an open°dONLNde9`Es* file.°dONLNdkYle®+   Result codes°dONLNdxeqö+ noErr°dONLNd~eq)è0°dONLNdÄe3q\)%No error°dONLNdâq}Æ(zrfNumErr°dONLNdíq})Ö-51°dONLNdñq3}„)/&The file reference number is not valid
  3732. °dONLNdΩü`ÆŒ(™`
  3733. UTAllocateVCB Æ^Ƨ
  3734. °dONLNdÀª`«*SUse the UTAllocateVCB function to allocate memory in the system heap for a new VCB.+˛-The Macintosh Volume Cache)ß3-)
  3735. 29ˇ
  3736. ⁄dˇ ˇˇˇˇd
  3737. d,Times
  3738. .+H2 Guide to the File System Manager,
  3739. Courier
  3740. °dONLNdUHaò*,8pascal OSErr UTAllocateVCB(unsigned short *sysVCBLength,°dONLNdAa˝mç+µ VCBPtr *volCtrlBlockPtr,°dONLNdbm˝yç* unsigned short addSize);
  3741. °dONLNd{ÑHêë(çH sysVCBLength°dONLNdàÑ¥êÛ)lAContains a pointer to an unsigned short. UTAllocateVCB places the°dONLNd ê¥úÌ* Dsize of the system VCB into the field referred to by this parameter.°dONLNd§H∞ì(≠HvolCtrlBlockPtr°dONLNd§¥∞˙)lBContains a pointer to an VCBPtr. UTAllocateVCB places a pointer to°dONLNdb∞¥ºæ* 9the new VCB into the field referred to by this parameter.°dONLNdúƒH–m(ÕHaddSize°dONLNd§ƒ¥–˚)lHContains the amount of addition storage to allocate for the foreign file°dONLNdÌ–¥‹@* system’s private use, or zero.°dONLNd ÓH˙Î(˜HRUTAllocateVCB will allocate cleared memory from the system heap for a new VCB. The°dONLNd_˙HÊ* Samount of memory allocated by UTAllocateVCB is determined by adding the size of the°dONLNd≥Hÿ* Ssystem VCB structure to the amount of additional memory needed for the foreign file°dONLNdH* ]system’s private use. A pointer to the new VCB is returned in volCtrlBlockPtr and the size of°dONLNdeH*Í* Wthe system VCB structure is returned in sysVCBLength. Thus, the additional foreign file°dONLNdΩ*H6ó* Fsystem private data (if any) starts at volCtrlBlockPtr + sysVCBLength.°dONLNdJTVê+   Result codes°dONLNdVgbÇ+ noErr°dONLNdVˆb¸)è0°dONLNdVbD)%No error°dONLNd"bgn†(kg
  3742. memFullErr°dONLNd-bÊn¸)-108°dONLNd2bnÌ)5)The VCB could not be allocated; no memory°dONLNd_nzD*     available,     Helvetica
  3743. °dONLNdiúH´∑(ßH UTAddNewVCB ´F´å
  3744. °dONLNdu∏Hƒ*RUse the UTAddNewVCB function to add a new VCB to the VCB queue and assign a volume°dONLNd»ƒH–·* reference number to the volume.
  3745. °dONLNdË›HÈò*8pascal OSErr UTAddNewVCB(short driveNum, short *vRefNum,°dONLNd(Èflıo+ó VCBPtr volCtrlBlockPtr);
  3746. °dONLNdAH x(    HdriveNum°dONLNdJ¥ ø)l8Contains the drive number of the drive the volume is on.°dONLNdÉH w(HvRefNum°dONLNd㥠Í)l<Contains a pointer to a short. UTAddNewVCB places the volume°dONLNd» ¥,ˆ* Ereference number assigned to the volume into the field referred to by°dONLNd,¥8˙* this parameter.°dONLNd@HLì(IHvolCtrlBlockPtr°dONLNd.@¥LΩ)l6Contains a pointer to the VCB to add to the VCB queue.°dONLNde^HjÒ(gHQUTAddNewVCB assigns an unused volume reference number to a VCB and adds it to the°dONLNd∑jHvä* >VCB queue. The volume reference number is returned in vRefNum.°dONLNdˆÇHéú*CThe following fields in the VCB are also initialized by UTAddNewVCB°dONLNd:öT¶X+ •°dONLNd<öa¶˜)
  3747. qType is assigned fsQType (5).°dONLNd[≤TæX(ªT•°dONLNd]≤aæ∞)
  3748. DvcbDrvNum is assigned the drive number of the drive the volume is on°dONLNd¢ T÷X(”T•°dONLNd§ a÷È)
  3749. PvcbDRefNum is assigned the driver reference number of the drive the volume is on(ÒH3-)
  3750. 30)&The Macintosh Volume Cacheˇ    Üdˇ ˇˇˇˇd
  3751. d,Times
  3752. .(2Ä The File System Utility Routines°dONLNdUlap(^l•°dONLNdUya~)
  3753. 2vcbVRefNum is assigned the volume reference number°dONLNd5mlyp(vl•°dONLNd7myy¶)
  3754. =vcbBufAdr may be assigned a value for the system’s cache use.°dONLNduÖ`ë (é`YIf the VCB is the first VCB added to the VCB queue (this will probably never happen for a°dONLNdœë`ùÚ* Oforeign file system), UTAddNewVCB will also make the volume the default volume.°dONLNd±lΩ®+   Result codes°dONLNd,Ω…ö+ noErr°dONLNd2Ω…)è0°dONLNd4Ω3…\)%No error°dONLNd=…’´(“paramErr°dONLNdF…’)Ö-50°dONLNdJ…3’∑)/volCtrlBlockPtr was NULL°dONLNdc’·´(finsDrvErr°dONLNdl’·)Ö-56°dONLNdp’3· )/,The drive specified by driveNum could not be°dONLNd†·3̶* found in the drive queue,     Helvetica
  3755. °dONLNdπ`Œ(` UTDisposeVCB ^§
  3756. °dONLNdΔ+`7*RUse the UTDisposeVCB function to dispose of a VCB allocated with the UTAllocateVCB°dONLNd7`Cã*     function.,
  3757. Courier
  3758. °dONLNd#P`\å*2pascal OSErr UTDisposeVCB(VCBPtr volCtrlBlockPtr);
  3759. °dONLNdVg`s´*volCtrlBlockPtr°dONLNdfgÃsë)l)Contains a pointer to the VCB to dispose.°dONLNdêÖ`ë(é`#UTDisposeVCB performs the following°dONLNd¥ùl©p+ •°dONLNd∂ùy©G)
  3760. +Close all working directories on the volume°dONLNd‚µl¡p(æl•°dONLNd‰µy¡1)
  3761. !Remove the VCB from the VCB queue°dONLNdÕlŸp(÷l•°dONLNdÕyŸ)
  3762. XIf the volume’s drive is ejectable, clear the dQFSID field in the DrvQEl of the volume’s°dONLNdaŸy½* Tdrive  (a disk owned by another file system could be the next disk inserted into the°dONLNd∂ÂyÒ¿* ejectable drive)°dONLNd«˝l    p(l•°dONLNd…˝y    ¡)
  3763. FIf the volume is the default volume, clear the system’s default volume°dONLNdl!p(l•°dONLNdy!;)
  3764. %Dispose of the memory used by the VCB°dONLNd8-`9˘(6`PYou should always use UTDisposeVCB to dispose of your VCB instead of freeing the°dONLNdâ9`Eµ* memory yourself.+˛ØThe Macintosh Volume Cache)ß3-)
  3765. 31ˇ édˇ ˇˇˇˇd
  3766. d,Times
  3767. .+H2 Guide to the File System Manager°dONLNdiTuê+ @ Result codes°dONLNd
  3768. ugÅÇ+ noErr°dONLNduˆÅ¸)è0°dONLNduÅD)%No error°dONLNdÅgçì(ägnsDrvErr°dONLNd'ÅÏç¸)Ö-56°dONLNd+Åç)/,The volume’s drive could not be found in the°dONLNd[çôR* drive queue,     Helvetica
  3769. °dONLNdgªH ˘(ΔHUTLocateVCBByRefNum  F å
  3770. °dONLNd{◊H„›*MUse the UTLocateVCBByRefNum function to locate a VCB using a volume reference°dONLNd…„HÔG* 2number, drive number, or working.directory number.,
  3771. Courier
  3772. °dONLNd¸¸Hº*>pascal OSErr UTLocateVCBByRefNum(short refNum, short *vRefNum,°dONLNdD ∂+ÿ VCBPtr *volCtrlBlockPtr);
  3773. °dONLNd^H+m((HrefNum°dONLNde¥+„)l<Contains a volume reference number, drive number, or working°dONLNd¢+¥7    * directory number.°dONLNd¥?HKw(HHvRefNum°dONLNdº?¥KÔ)l=Contains a pointer to a short. UTLocateVCBByRefNum places the°dONLNd˙K¥W˛* Greference number of the volume found into the field referred to by this°dONLNdBW¥cÊ*
  3774. parameter.°dONLNdMkHwì(tHvolCtrlBlockPtr°dONLNd]k¥wÙ)l<Contains a pointer to a VCBPtr. UTLocateVCBByRefNum places a°dONLNdöw¥Éˆ* Fpointer to the VCB found into the field referred to by this parameter.°dONLNd·ïH°˙(ûHRUTLocateVCBByRefNum finds the VCB associated with a volume reference number, drive°dONLNd4°H≠Û* Wnumber, or working.directory number and returns a pointer to the VCB in volCtrlBlockPtr°dONLNdå≠Hπ'* +and the volume reference number in vRefNum.°dONLNd∏ÕTŸê+   Result codes°dONLNd≈ŸgÂÇ+ noErr°dONLNdÀŸˆ¸)è0°dONLNdÕŸÂD)%No error°dONLNd÷ÂgÒñ(ÓgrfNumErr°dONLNdflÂÏÒ¸)Ö-51°dONLNd„ÂÒÂ)/)The working directory reference number is°dONLNdÒ˝;* invalid°dONLNd˝g    á(gnsvErr°dONLNd˝Ï    ¸)Ö-56°dONLNd#˝    )/+A matching volume could not be found in the°dONLNdR    R*     VCB queue
  3775. °dONLNd\7HFÈ(BHUTLocateVCBByName FFFå
  3776. °dONLNdnSH_Í*RUse the UTLocateVCBByName function to locate the first VCB that matches the volume°dONLNd¡_Hkí* name specified.
  3777. °dONLNd—xHÑÊ*Epascal OSErr UTLocateVCBByName(StringPtr namePtr, short *moreMatches,°dONLNdÑ˝êÌ+µ (short *vRefNum, VCBPtr *volCtrlBlockPtr)
  3778. °dONLNdHõHßo(§HnamePtr°dONLNdPõ¥ß˝)lDContains a pointer to a volume name (which must end with a colon ‘:’°dONLNdïߥ≥J* !character) or to a full pathname.(ÒH3-)
  3779. 32)&The Macintosh Volume Cacheˇ dˇ ˇˇˇˇd
  3780. d,Times
  3781. .(2Ä The File System Utility Routines°dONLNdW`cü(`` moreMatches°dONLNd WÃcÒ)l@Contains a pointer to a short. If there is another volume with a°dONLNdMcÃo˙* 9matching name, UTLocateVCBByName places the length of the°dONLNdáoÃ{* Ivolume name (not including the trailing colon) into the field referred to°dONLNd—{Ãá * Eby this parameter. If this is the last volume with a matching name or°dONLNdáÃì* <no matches are found, UTLocateVCBByName places zero into the°dONLNdTìÃüm* $field referred to by this parameter.°dONLNdyß`≥è(∞`vRefNum°dONLNdÅßÃ≥˙)l;Contains a pointer to a short. UTLocateVCBByName places the°dONLNdΩ≥Ãø* Greference number of the volume found into the field referred to by this°dONLNdøÃÀ˛*
  3782. parameter.°dONLNd”`fl´(‹`volCtrlBlockPtr°dONLNd ”Ãflˇ)l:Contains a pointer to a VCBPtr. UTLocateVCBByName places a°dONLNd[flÃÎ* Fpointer to the VCB found into the field referred to by this parameter.°dONLNd¢˝`    (`RUTLocateVCBByName finds the first VCB with the specified volume name and returns a°dONLNdı    `ı* Qpointer to the VCB in volCtrlBlockPtr and the volume reference number in vRefNum.°dONLNdG!`-*TUTLocateVCBByName also checks to see if there are more volumes in the VCB queue with°dONLNdú-`9 * [the specified name. If there are, moreMatches returns the length of the volume name. If the°dONLNd¯9`E* Vvolume found is the only volume with the specified name (or if no matching volumes are°dONLNdOE`Q * Wfound), moreMatches returns zero. To find the next volume with a matching name, use the°dONLNdßQ`]Ê* UTLocateNextVCB routine.°dONLNd¿ql}®+   Result codes°dONLNdÕ}âö+ noErr°dONLNd”}â)è0°dONLNd’}3â\)%No error°dONLNdfiâï±(íbdNamErr°dONLNdÁâï)Ö-37°dONLNdÎâ3ï)/+namePtr was NULL, or namePtr does not point°dONLNdï3°÷* !to a volume name or full pathname°dONLNd=°≠ü(™nsvErr°dONLNdD°≠)Ö-56°dONLNdH°3≠)/+A matching volume could not be found in the°dONLNdw≠3πj*     VCB queue,     Helvetica
  3783. °dONLNdÅ€`ÍÊ(Ê`UTLocateNextVCB Í^ͧ
  3784. °dONLNdë˜`    *RUse the UTLocateNextVCB function to continue seaching for a VCB by name in the VCB°dONLNd‰`Ä* queue.,
  3785. Courier
  3786. °dONLNdÎ`(Ú*Cpascal OSErr UTLocateNextVCB(StringPtr namePtr, short *moreMatches,°dONLNd7(4 +µ )short *vRefNum, VCBPtr *volCtrlBlockPtr);
  3787. °dONLNda?`Ká(H`namePtr°dONLNdi?ÃK)lDContains a pointer to a volume name (which must end with a colon ‘:’°dONLNdÆKÃWb* !character) or to a full pathname.°dONLNd–_`kü(h` moreMatches°dONLNd‹_Ãk)lFContains a pointer to a short. On input, the field referred to by this°dONLNd#kÃw* Aparameter contains the length of the volume name as returned by a°dONLNdewÃÉ* 9previous call to UTLocateVCBByName or UTLocateNextVCB, or°dONLNdüÉÃè* Bzero to force UTLocateNextVCB to re-parse the pathname. On output,°dONLNd‚èÃõÒ* 9UTLocateNextVCB places the length of the volume name (not°dONLNdõÃß* Kincluding the trailing colon) into the field referred to by this parameter.°dONLNdhßÃ≥˝* AIf this is the last volume with a matching name or no matches are°dONLNd™≥Ãø* Dfound UTLocateNextVCB places zero into the field referred to by this°dONLNdÔøÃÀ˛*
  3788. parameter.+í)The Macintosh Volume Cache)ß3-)
  3789. 33ˇÃdˇ ˇˇˇˇd
  3790. d,Times
  3791. .+H2 Guide to the File System Manager°dONLNdUHaw*,vRefNum°dONLNdU¥a˝)lCContains a pointer to a short. UTLocateNextVCB places the reference°dONLNdLa¥m–* =number of the volume found into the field referred to by this°dONLNdäm¥yÊ*
  3792. parameter.°dONLNdïÅHçì(äHvolCtrlBlockPtr°dONLNd•Å¥ç¯)l@Contains a pointer to a VCBPtr. UTLocateNextVCB places a pointer°dONLNdÊç¥ô“* >to the VCB found into the field referred to by this parameter.°dONLNd%´H∑(¥HRUTLocateNextVCB finds the next VCB with the specified volume name. UTLocateNextVCB°dONLNdx∑H√* Zalways starts searching from the VCB specified by volCtrlBlockPtr and returns the next VCB°dONLNd”√Hœπ* Jit finds in the VCB queue. UTLocateNextVCB returns a pointer to the VCB in°dONLNdœH€u* ;volCtrlBlockPtr and the volume reference number in vRefNum.°dONLNdZÁHÛ*ZAfter finding a match, UTLocateNextVCB also checks to see if there are more volumes in the°dONLNdµÛHˇ‰* VVCB queue with the specified name. If there are, moreMatches returns the length of the°dONLNd ˇH ‚* Uvolume name. If the volume found is the only volume with the specified name (or if no°dONLNdb HW* 6matching volumes are found), moreMatches returns zero.°dONLNdô+T7ê+   Result codes°dONLNd¶7gCÇ+ noErr°dONLNd¨7ˆC¸)è0°dONLNdÆ7CD)%No error°dONLNd∑CgOô(LgbdNamErr°dONLNd¿CÏO¸)Ö-37°dONLNdƒCO¸)/+namePtr was NULL, or namePtr does not point°dONLNdÛO[æ* !to a volume name or full pathname°dONLNd[ggá(dgnsvErr°dONLNd[Ïg¸)Ö-56°dONLNd![g)/+A matching volume could not be found in the°dONLNdPgsR*     VCB queue,     Helvetica
  3793. °dONLNdZïH§≈(†HUTAllocateWDCB §F§
  3794. °dONLNdi±HΩÊ*RUse the UTAllocateWDCB function to allocate a working directory in the WDCB array.,
  3795. Courier
  3796. °dONLNdº H÷h*0pascal OSErr UTAllocateWDCB(WDPBPtr paramBlock);
  3797. °dONLNdÌ·HÌÅ*
  3798. paramBlock°dONLNd¯·¥Ì»)l:Contains a pointer to a working directory parameter block.°dONLNd3T±(TParameter Block,    Symbol°dONLNdCT$a*´°dONLNdEg#°)    ioVRefNum°dONLNdOÿ#)qshort°dONLNdU;#˜)c'On input, contains the volume reference°dONLNdÅ$;0‘*
  3799. number. On output, contains the°dONLNd•0;<È* #working directory reference number.°dONLNd…<TM`(IT¨°dONLNdÀ@gLß) ioWDCreated°dONLNd◊@ÿL)qshort°dONLNd›@;LË)c&If a working directory is not created,°dONLNdM;YÛ*
  3800. (zero is returned. If a working directory°dONLNd5Y;e—* !is created, non-zero is returned.°dONLNdWeTv`(rTưdONLNdYigu•)
  3801. ioWDProcID°dONLNddiÿuÌ)qlong°dONLNdii;uÂ)c#Contains the working directory user°dONLNdëv;Çi*
  3802. identifier.°dONLNdùÇTì`(èTưdONLNdüÜgíû)    ioWDDirID°dONLNd©ÜÿíÌ)qlong°dONLNdÆÜ;í◊)c Contains the working directory’s°dONLNd”ì;üx*
  3803.  
  3804. directory ID.°dONLNd·ØHª‘(∏HJUTAllocateWDCB uses the ioVRefNum, ioWDProcID, and ioPDDirID fields in the°dONLNd,ªH«˝* TWDPBRec to allocate a working directory in the WDCB array. UTAllocateWDCB places the°dONLNdÅ«H”Δ* Kworking directory reference number into the ioVRefNum field of the WDPBRec.*!3-)
  3805. 34)&The Macintosh Volume Cacheˇ ^dˇ ˇˇˇˇd
  3806. d,Times
  3807. .(2Ä The File System Utility Routines°dONLNdU`aÈ(^`SIf the specified directory has already been made a working directory using the same°dONLNdTa`m˙* VioWDProcID value, a new working directory will not be allocated; instead, the existing°dONLNd´m`y* Xworking directory reference number will be returned and ioWDCreated will be set to zero.°dONLNdÖlëì+ Note:  °dONLNd Öìëfi)'FThe ioWDCreated field is named filler1 in current versions of Files.C.°dONLNdR£`Ø∑(¨`IIf a WDCB array cannot be allocated, this function will return a tmfoErr.°dONLNdúªl«ã+ Note:°dONLNd°ªã«Ò)I If all WDCBRecs in the WDCB array are in use, an attempt will be made to°dONLNdΫl”˝(–lPenlarge the WDCB array. Because enlarging the WDCB array will change the array’s°dONLNd<”lfl* Qlocation in memory, you should never save the location of a WDCBRec between calls°dONLNdéfllÎÙ* Pto your foreign file system. A WDCBRecPtr can only be used within the context of°dONLNdflÎl˜Ê* one file system operation.°dONLNd˙    `(`VWhen you no longer need an allocated working directory, release it with UTReleaseWDCB.°dONLNdQ)l5®+   Result codes°dONLNd^5Aö+ noErr°dONLNdd5A)è0°dONLNdf53A\)%No error°dONLNdoAM§(JtmfoErr°dONLNdwAM)Ö-42°dONLNd{A3M)/&There are no free WDCBRecs in the WDCB°dONLNd•M3YK* array,     Helvetica
  3808. °dONLNd´{`äfi(Ü`
  3809. UTReleaseWDCB ä^ä§
  3810. °dONLNdπó`£ *TUse the UTReleaseWDCB function to release an allocated working directory in the WDCB°dONLNd£`Ø* 'array when closing a working directory.,
  3811. Courier
  3812. °dONLNd6º`»b*+pascal OSErr UTReleaseWDCB(short wdRefNum);
  3813. °dONLNdb”`flò*wdRefNum°dONLNdk”Ãfl)lBContains the working directory reference number that specifies the°dONLNdÆflÃÎT* working directory to release.°dONLNdÃ˝`    (`VWhen you no longer need an allocated working directory, release it with UTReleaseWDCB.°dONLNd#    `‰* IUTReleaseWDCB will release an WDCBRec in the WDCB array and mark it free.°dONLNdm)l5®+   Result codes°dONLNdz5Aö+ noErr°dONLNdÄ5A)è0°dONLNdÇ53A\)%No error°dONLNdãAMÆ(JrfNumErr°dONLNdîAM)Ö-51°dONLNdòA3M)/-The working directory reference number is not°dONLNd…M3Y˙* *valid or does not refer to an open working°dONLNd˜Y3e]*     directory
  3814. °dONLNdá`ñ›(í`
  3815. UTResolveWDCB ñ^ñ§
  3816. °dONLNd£`ØŒ*CUse the UTResolveWDCB function to find a WDCBRec in the WDCB array.
  3817. °dONLNdSº`»*Fpascal OSErr UTResolveWDCB(long procID, short wdIndex, short wdRefNum,°dONLNd¢»‘Ω+µ WDCBRecPtr *wdCtrlBlockPtr);
  3818. +I The Macintosh Volume Cache)ß3-)
  3819. 35ˇ
  3820. Δdˇ ˇˇˇˇd
  3821. d,Times
  3822. .+H2 Guide to the File System Manager°dONLNdUHai*,procID°dONLNdU¥a¶)l4Contains a working directory user identifier or zero°dONLNd<iHur(rHwdIndex°dONLNdDi¥u
  3823. )lContains an index.°dONLNdW}HâÄ(ÜHwdRefNum°dONLNd`}¥âÌ)lBContains the working directory reference number that specifies the°dONLNd£â¥ïÔ* Aworking directory, or contains a volume reference number or drive°dONLNdÂ殺S* !number that specifies the volume.°dONLNd©Hµì(≤HwdCtrlBlockPtr°dONLNd©¥µÏ)l:Contains a pointer to a WDCBRecPtr. UTResolveWDCB places a°dONLNdQµ¥¡fi* ?pointer to the WDCBRec found into the field referred to by this°dONLNdë¡¥ÕÊ*
  3824. parameter.°dONLNdúflHÎ◊(ËHKUTResolveWDCB locates a WDCBRec in the WDCB array according to these rules:°dONLNd˘TX+ •°dONLNd͘a˛)
  3825. RIf wdIndex is zero or negative, UTResolveWDCB uses the working directory reference°dONLNd=a˜* Onumber in wdRefNum to find the WDCBRec. The procID parameter is ignored in this°dONLNdçay* case.°dONLNdì'T3X(0T•°dONLNdï'a3Á)
  3826. JIf wdIndex is positive and procID is zero, UTResolveWDCB finds the WDCBRec°dONLNd·3a?Ó* Mwhose working directory index is wdIndex on the volume specified by wdRefNum.°dONLNd/KTWX(TT•°dONLNd1KaW˝)
  3827. NIf wdIndex is positive and procID is non-zero, UTResolveWDCB finds the WDCBRec°dONLNdÅWacÚ* Swhose working directory index is wdIndex with the working directory user identifier°dONLNd’cao* 8specified by procID on the volume specified by wdRefNum.°dONLNdÉTèê(åT Result codes°dONLNdègõÇ+ noErr°dONLNd!èˆõ¸)è0°dONLNd#èõD)%No error°dONLNd,õgßá(§gnsvErr°dONLNd3õÏ߸)Ö-35°dONLNd7õßÙ)/*No matching working directory was found by°dONLNdeß≥r* the indexed search°dONLNdx≥gøñ(ºgrfNumErr°dONLNdÅ≥Ïø¸)Ö-51°dONLNdÖ≥ø˜)/-The working directory reference number is not°dONLNd∂øÀ‚* *valid or does not refer to an open working°dONLNd‰À◊E*     directory,     Helvetica
  3828. °dONLNdÓ˘H£(H UTFindDrive Få
  3829. °dONLNd˙H!ø*NUse the UTFindDrive function to find a drive queue element in the drive queue.,
  3830. Courier
  3831. °dONLNdI.H:Ï*Fpascal OSErr UTFindDrive(short driveNum, DrvQElPtr *driveQElementPtr);
  3832. °dONLNdêEHQx*driveNum°dONLNdôE¥Q°)l3Contains the drive number that specifies the drive.°dONLNdÕYHeú(bHdriveQElementPtr°dONLNdfiY¥eÚ)lBContains a pointer to a DrvQElPtr. UTFindDrive places a pointer to°dONLNd!e¥q◊* @the drive queue element found into the field referred to by this°dONLNdbq¥}Ê*
  3833. parameter.°dONLNdmèHõÍ(òHWUTFindDrive locates a drive queue element in the drive queue. If a matching drive queue°dONLNd≈õHß˚* [element is found and its dQFSID field is zero, UTFindDrive will return noErr. If a matching°dONLNd!ßH≥˚* [drive queue element is found and its dQFSID field is not zero (when the drive is owned by a°dONLNd}≥HøQ* 7foreign file system), UTFindDrive will return extFSErr.*53-)
  3834. 36)&The Macintosh Volume Cacheˇ zdˇ ˇˇˇˇd
  3835. d,Times
  3836. .(2Ä The File System Utility Routines°dONLNdUla®(^l Result codes°dONLNd
  3837. amö+ noErr°dONLNdam)è0°dONLNda3mˇ)%(A matching drive queue element was found°dONLNdAm3y™* with a zero dQFSID field°dONLNdZyÖ´(ÇnsDrvErr°dONLNdcyÖ)Ö-56°dONLNdgy3Ö)/)No matching drive queue element was found°dONLNdëÖë™(éextFSErr°dONLNdöÖë)Ö-58°dONLNdûÖ3ëˇ)/(A matching drive queue element was found°dONLNd ë3ù¿* with a non-zero dQFSID field,     Helvetica
  3838. °dONLNdÁø`Œ¬( ` UTAdjustEOF Œ^Œ§
  3839. °dONLNdÛ€`Á*XUse the UTAdjustEOF function to adjust the logical and physical EOF of all open FCBs for°dONLNdLÁ`Û»* the specified file fork.,
  3840. Courier
  3841. °dONLNde` b*+pascal OSErr UTAdjustEOF(short fileRefNum);
  3842. °dONLNdë`#ò*
  3843. fileRefNum°dONLNdúÃ#)lEContains a file reference number that specifies the reference FCBRec.°dONLNd‚5`A(>`WUTAdjustEOF finds the open FCB specified by fileRefNum and gets that file’s file number°dONLNd:A`M* Xand VCBPtr. UTAdjustEOF then copies the logical end of file (fcbEOF) and physical end of°dONLNdìM`Y * Yfile (fcbPLen) from the specified FCBRec to all other open FCBRecs that refer to the same°dONLNdÌY`eä*
  3844. file fork.°dONLNd¯ylÖ®+   Result codes°dONLNdÖëö+ noErr°dONLNd Öë)è0°dONLNd
  3845. Ö3ë\)%No error°dONLNdëùÆ(örfNumErr°dONLNdëù)Ö-51°dONLNd#ë3ù„)/&The file reference number is not valid
  3846. °dONLNdJø`Œÿ( `UTSetDefaultVol Œ^Œ§
  3847. °dONLNdZ€`Á*ZUse UTSetDefaultVol to set the default volume and working directory in response to _SetVol°dONLNdµÁ`Û†* or _HSetVol.
  3848. °dONLNd¬` ‡*@pascal OSErr UTSetDefaultVol(long nodeHint, unsigned long dirID,°dONLNd
  3849.  i+µ short refNum);
  3850. °dONLNd#`/å(,`nodeHint°dONLNd"#Ã/)lHContains a long that specifies optional file system specific information°dONLNdk/Ã;(* about the directory.°dONLNdÄC`Oy(L`dirID°dONLNdÜCÃOT)lContains a directory ID or 0.°dONLNd§W`cÖ(``refNum°dONLNd´WÃc)lAContains a volume reference number or a working directory number.°dONLNdÌu`Å˘(~`SThe parameters you pass to UTSetDefaultVol depend on which file system call you are°dONLNdAÅ`ç¸* Vresponding to, _SetVol or _HSetVol, and on the parameters passed the file system call.°dONLNdòô`•˘*RIf you are responding to _SetVol and ioVRefNum is a working directory number, then°dONLNdΕ`±* TrefNum must be set to the working directory number (ioVRefNum), dirID must be 0, and°dONLNd@±`Ω* \nodeHint is ignored (nodeHint information is obtained from the working directory specified).+˛7The Macintosh Volume Cache)ß3-)
  3851. 37ˇ
  3852. §dˇ ˇˇˇˇd
  3853. d,Times
  3854. .+H2 Guide to the File System Manager°dONLNdUHaÍ*,TIf you are responding to _SetVol and ioVRefNum is a volume reference number or drive°dONLNdUaHm˝* Tnumber, then refNum must be the volume reference number (obtained from vcbVRefNum in°dONLNd™mHyÈ* Wthe VCB), dirID must be set to fsRtDirID, and nodeHint can contain optional file system°dONLNdyHÖQ* 9specific information about the directory that you supply.°dONLNd<ëHù„*RIf you are responding to _HSetVol, then refNum must be the volume reference number°dONLNdèùH©* V(obtained from vcbVRefNum in the VCB), dirID must be be the directory specified by the°dONLNdÊ©Hµ˚* Wcombination of ioVRefNum, ioDirID and ioNamePtr, and nodeHint can contain optional file°dONLNd>µH¡u* @system specific information about the directory that you supply.°dONLNd’T·ê+   Result codes°dONLNdå·gÌÇ+ noErr°dONLNdí·ˆÌ¸)è0°dONLNdî·ÌD)%No error°dONLNdùÌg˘ñ(ˆgrfNumErr°dONLNd¶ÌÏ˘¸)Ö-51°dONLNd™Ì˘É)/The refNum is invalid,     Helvetica
  3855. °dONLNd¿H*¬(&HUTGetDefaultVol *F*å
  3856. °dONLNd–7HC⁄*RUse UTGetDefaultVol to get the default volume and working directory in response to°dONLNd#CHOµ* _GetVol or _HGetVol.,
  3857. Courier
  3858. °dONLNd8\Hhn*1pascal OSErr UTGetDefaultVol(WDPBPtr paramBlock);
  3859. °dONLNdjsHÅ*
  3860. paramBlock°dONLNdus¥»)l:Contains a pointer to a working directory parameter block.°dONLNd∞ôT•±(¢TParameter Block,    Symbol°dONLNd¿•T∂`*¨°dONLNd¬©gµö)    ioNamePtr°dONLNdéÿµÌ)qlong°dONLNd—©;µœ)c Contains a pointer to a Str31 or°dONLNdˆ∂;¬˙*
  3861. "NULL. If not NULL, UTGetDefaultVol°dONLNd¬;Œ* *will return the volume’s name in the Str31°dONLNdLŒ;⁄§* specified by this field.°dONLNde⁄TÎ`(ÁT¨°dONLNdgfigͰ)    ioVRefNum°dONLNdqfiÿÍ)qshort°dONLNdwfi;ÍÎ)c"UTGetDefaultVol places the working°dONLNdûÎ;˜Û*
  3862. &directory number of the default volume°dONLNd…˜;t* in this field.°dONLNdŸT`(T¨°dONLNd€g•)
  3863. ioWDProcID°dONLNdÊÿÌ)qlong°dONLNdÎ;Î)c"UTGetDefaultVol places the working°dONLNd; Â*
  3864. (directory user identifier in this field.°dONLNd; T1`(-T¨°dONLNd=$g0¥) ioWDVRefNum°dONLNdI$ÿ0)qshort°dONLNdO$;0Ê)c!UTGetDefaultVol places the volume°dONLNdu1;=Ù*
  3865. &reference number of the default volume°dONLNd†=;It* in this field.°dONLNdØITZ`(VT¨°dONLNd±MgYû)    ioWDDirID°dONLNdªMÿYÌ)qlong°dONLNd¿M;YÌ)c$UTGetDefaultVol places the directory°dONLNdÈZ;fË*
  3866. %ID number of the default directory in°dONLNdf;rh* this field.°dONLNdÇHéı(ãHWUTGetDefaultVol returns the default volume name, the default volume’s working directory°dONLNdwéHö˝* [number, the default volume’s user identifier, the default volume’s volume reference number,°dONLNd”öH¶** 0and the default directory’s directory ID number.*N3-)
  3867. 38)&The Macintosh Volume Cacheˇ dˇ ˇˇˇˇd
  3868. d,Times
  3869. .(2Ä The File System Utility Routines°dONLNdUla®(^l Result codes°dONLNd
  3870. amö+ noErr°dONLNdam)è0°dONLNda3m\)%No error°dONLNdmyü(vnsvErr°dONLNd%my)Ö-35°dONLNd)m3y¬)/ The default directory is not set,     Helvetica
  3871. °dONLNdJõ`™∞(¶`
  3872. UTEjectVol ™^™§
  3873. °dONLNdU∑`√^*5Use UTEjectVol to eject a volume and mark it offline.,
  3874. Courier
  3875. °dONLNdã–`‹Ä*0pascal OSErr UTEjectVol(VCBPtr volCtrlBlockPtr);
  3876. °dONLNdºÁ`Û´*volCtrlBlockPtr°dONLNdÃÁÃÛ)lFContains a pointer to the VCB of the volume to eject and mark offline.°dONLNd`(`ZUTEjectVol ejects and marks offline the volume specified by volCtrlBlockPtr. If the volume°dONLNdn`˜* Uhas already been ejected, UTEjectVol does nothing and returns noErr. If the volume is°dONLNdƒ`)î* Dalready offline, but has not been ejected, UTEjectVol will eject it.°dONLNd    5`A *[If the volume’s drive is ejectable, UTEjectVol clears the dQFSID field in the DrvQEl of the°dONLNdeA`M* \volume’s drive (a disk owned by another file system could be the next disk inserted into the°dONLNd¬M`Y´* ejectable drive).°dONLNd‘elqã+ Note:°dONLNdŸeãq˝)N Before calling UTEjectVol, the foreign file system must flush any cached data°dONLNd(ql}Œ(zlJassociated with the volume using UTFlushCache. If the device is ejectable,°dONLNds}lâ’* JUTFlushCache's fcOption should be set to fcTrashMask. If the device is not°dONLNdæâlïô* >ejectable, UTFlushCache's rbOption should be set to rbDefault.°dONLNd˝Ølª®*& Result codes°dONLNd
  3877. ª«ö+ noErr°dONLNdª«)è0°dONLNdª3«\)%No error°dONLNd«”´(–paramErr°dONLNd$«”)Ö-50°dONLNd(«3”
  3878. )/-volCtrlBlockPtr does not point to a valid VCB°dONLNdV”flÆ(‹Dany of the result codes returned by the disk driver to an eject call
  3879. °dONLNdõ`ı( `UTCheckWDRefNum ^§
  3880. °dONLNd´`)
  3881. *RUse UTCheckWDRefNum to make sure a working directory reference number is valid and°dONLNd˛)`5{* open.
  3882. °dONLNdB`Nn*-pascal OSErr UTCheckWDRefNum(short wdRefNum);
  3883. °dONLNd2Y`eò*wdRefNum°dONLNd;YÃe∏)l0Contains the working directory reference number.°dONLNdlw`É(Ä`VUTCheckWDRefNum will return noErr if a working directory reference number is valid and°dONLNd√É`è{* open.+˛eThe Macintosh Volume Cache)ß3-)
  3884. 39ˇ
  3885. Vdˇ ˇˇˇˇd
  3886. d,Times
  3887. .+H2 Guide to the File System Manager°dONLNdiTuê+ @ Result codes°dONLNd
  3888. ugÅÇ+ noErr°dONLNduˆÅ¸)è0°dONLNduÅD)%No error°dONLNdÅgçñ(ägrfNumErr°dONLNd'ÅÏç¸)Ö-51°dONLNd+Åç˜)/-The working directory reference number is not°dONLNd\çô‚* *valid or does not refer to an open working°dONLNdäô•E*     directory,     Helvetica
  3889. °dONLNdî«H÷fl(“HUTCheckFileRefNum ÷F÷å
  3890. °dONLNd¶„HÔÃ*MUse UTCheckFileRefNum to make sure a file reference number is valid and open.,
  3891. Courier
  3892. °dONLNdÙ¸Hn*1pascal OSErr UTCheckFileRefNum(short fileRefNum);
  3893. °dONLNd&HÄ*
  3894. fileRefNum°dONLNd1¥Z)l#Contains the file reference number.°dONLNdU1H=”(:HQUTCheckFileRefNum will return noErr if a file reference number is valid and open.°dONLNdßQT]ê+   Result codes°dONLNd¥]giÇ+ noErr°dONLNd∫]ˆi¸)è0°dONLNdº]iD)%No error°dONLNd≈iguñ(rgrfNumErr°dONLNdŒiÏu¸)Ö-51°dONLNd“iuÒ)/.The file reference number is not valid or does°dONLNduÅâ* not refer to an open file
  3895. °dONLNd£H≤€(ÆHUTCheckVolRefNum ≤F≤å
  3896. °dONLNd/øHÀ±*EUse UTCheckVolRefNum to make sure a volume reference number is valid.
  3897. °dONLNduÿH‰V*-pascal OSErr UTCheckVolRefNum(short vRefNum);
  3898. °dONLNd£ÔH˚w*vRefNum°dONLNd´Ô¥˚n)l%Contains the volume reference number.°dONLNd—
  3899. Hˇ(HUUTCheckVolRefNum will return noErr if a volume reference number is valid. The vRefNum°dONLNd'H%‰* Tparameter must be a volume reference number, not a driver number, zero, or a working°dONLNd|%H1À* directory reference number.°dONLNdòETQê+   Result codes°dONLNd•Qg]Ç+ noErr°dONLNd´Qˆ]¸)è0°dONLNd≠Q]D)%No error°dONLNd∂]giñ(fgrfNumErr°dONLNdø]Ïi¸)Ö-51°dONLNd√]ifl)/(The volume reference number is not valid
  3900. °dONLNdÏãHö⁄(ñHUTCheckPermission öFöå
  3901. °dONLNd˛ßH≥˝*XUse UTCheckPermission to check the file access permission requested in response to _Open°dONLNdW≥HøŒ* Ror _OpenRF if your foreign file system is using the Macintosh file system’s access°dONLNd™øHÀ†* permission model.*)3-)
  3902. 40)&The Macintosh Volume Cacheˇbdˇ ˇˇˇˇd
  3903. d,Times
  3904. .(2Ä The File System Utility Routines,
  3905. Courier
  3906. °dONLNdU`a(^`Fpascal OSErr UTCheckPermission(VCBPtr volCtrlBlockPtr, short *modByte,°dONLNdPa8mº+ÿ unsigned long fileNum,°dONLNdpm8y¬* ParmBlkPtr paramBlock);
  3907. °dONLNdàÑ`ê´(ç`volCtrlBlockPtr°dONLNdòÑÃê )lDContains a VCBPtr that specifies the volume the file to be opened is°dONLNd›êÃú‹* on.°dONLNd·§`∞ã(≠`modByte°dONLNdȧÃ∞)lFContains a pointer to a short. On input, the field referred to by this°dONLNd0∞ú* Dparameter contains the values your file system plans to put into the°dONLNduºÃ»
  3908. * EfcbFlags (in the high byte) and fcbTypByt (in the low byte) fields in°dONLNdª»Ã‘* Athe FCB. On output, UTCheckPermission places the corrected values°dONLNd˝‘Ç* Hfor fcbFlags and fcbTypByt into the field referred to by this parameter.°dONLNdFË`Ùá(Ò`fileNum°dONLNdNËÃÙ›)l<Contains a file number that specifies the file to be opened.°dONLNdã¸`ô(`
  3909. paramBlock°dONLNdñ¸Ã)lCContains a pointer to the parameter block used to make the _Open or°dONLNd⁄Ã* _Open request.°dONLNdÈ&`2(/`YUTCheckPermission will check the file access permission requested in response to _Open or°dONLNdC2`>* [_OpenRF to see if it is possible using the Macintosh file system’s access permission model.°dONLNdüJ`V*^Before making this call, the foreign file system must determine what file number the open file°dONLNd˛V`b* Pwill have. The file number along with the VCBPtr will allow UTCheckPermission to°dONLNdOb`n
  3910. * ]determine if the requested access permission will conflict with any other access paths to the°dONLNd≠n`zs* file.°dONLNd≥Ü`í*YThe foreign file system must also determine what values will be put into the fcbFlags and°dONLNd
  3911. í`û˝* RfcbTypByt fields of the FCBRec and supply those values to UTCheckPermission in the°dONLNd`û`™¬* ImodByte parameterr; fcbFlags in the high byte, fcbTypByt in the low byte.°dONLNd™∂`¬`*7The bits for the fcbFlags byte should be set as follows°dONLNd‚Œl⁄p+ •°dONLNd‰Œy⁄)
  3912. XThe fcbWriteBit should be set if the requested permissions in the ioPermssn field of the°dONLNd=⁄yÊÓ* Eparameter block are fsCurPerm, fsWrPerm, fsRdWrPerm, or fsRdWrShPerm.°dONLNdÉÚl˛p(˚l•°dONLNdÖÚy˛Œ)
  3913. EThe fcbResourceBit should be set if responding to an _OpenRF request.°dONLNdÀ
  3914. lp(l•°dONLNdÕ
  3915. y)
  3916. WThe fcbSharedWriteBit should be set if the requested permissions in the ioPermssn field°dONLNd%y"F* (of the parameter block are fsRdWrShPerm.°dONLNdN.l:p(7l•°dONLNdP.y:)
  3917. 9The fcbFileLockedBit should be set if the file is locked.°dONLNdäF`RX(O`8All other bits in in the fcbFlags field should be clear.°dONLNd√^`j *YThe fcbTypByt (used for the file version by the MFS file system) must be zero because the°dONLNdj`v* WResource Manager, Segment Loader, and Standard File Package won’t operate on files with°dONLNduv`LJ* non-zero version numbers.°dONLNdèé`ö˜*SIf UTCheckPermission returns noErr, then the value returned in modByte contains the°dONLNd„ö`¶* Ycorrected values for fcbFlags and fcbTypByt and may be copied into the FCBRec for the new°dONLNd    =¶`≤ô* access path.°dONLNd    Jæ` ¯*TIf UTCheckPermission returns opWrErr, then the file reference number of the existing°dONLNd    ü `÷Œ* Nexclusive-write path is returned in the ioRefNum field of the parameter block.+˛The Macintosh Volume Cache)ß3-)
  3918. 41ˇ ~dˇ ˇˇˇˇd
  3919. d,Times
  3920. .+H2 Guide to the File System Manager°dONLNdUHa◊*,TFor a description of the Macintosh file system’s access permission model, see Inside°dONLNdUaHmÒ* RMacintosh: Files pages 2-7 and 2-8 and the description of PBHOpen and PBHOpenRF on°dONLNd®mHyÕ* pages 2-184 through 2-186.°dONLNd√çTôê+   Result codes°dONLNd–ôg•Ç+ noErr°dONLNd÷ôˆ•¸)è0°dONLNdÿô•D)%No error°dONLNd·•g±ë(ÆgopWrErr°dONLNdȕϱ¸)Ö-49°dONLNdÌ•±Ú)/%fsWrPerm, fsRdWrPerm, or fsRdWrShPerm°dONLNd±Ω’* (was requested on a file with an existing°dONLNdBΩ…õ* exclusive-write access path°dONLNd^…g’é(“gpermErr°dONLNdf…Ï’¸)Ö-54°dONLNdj…’Ú)/%fsWrPerm, fsRdWrPerm, or fsRdWrShPerm°dONLNdì’·©* was requested on a locked file,     Helvetica
  3921. °dONLNd≤H—(HUTCheckVolOffline Få
  3922. °dONLNdƒH+˚*WUse UTCheckVolOffline to make sure a volume reference number is valid and the volume is°dONLNd+H7i* online.,
  3923. Courier
  3924. °dONLNd$DHP\*.pascal OSErr UTCheckVolOffline(short vRefNum);
  3925. °dONLNdS[Hgw*vRefNum°dONLNd[[¥gn)l%Contains the volume reference number.°dONLNdÅyHÖ(ÇH[UTCheckVolOffline will return noErr if a volume reference number is valid and the volume is°dONLNd›ÖHëi* online.°dONLNd•T±ê+   Result codes°dONLNdÚ±gΩÇ+ noErr°dONLNd¯±ˆΩ¸)è0°dONLNd˙±ΩD)%No error°dONLNdΩg…ñ(ΔgrfNumErr°dONLNd ΩÏ…¸)Ö-51°dONLNdΩ…fl)/(The volume reference number is not valid°dONLNd9…g’•(“g volOffLinErr°dONLNdF…Ï’¸)Ö-53°dONLNdJ…’Ä)/The volume is offline
  3926. °dONLNd`˜HÏ(HUTCheckVolModifiable Få
  3927. °dONLNduH{*>Use UTCheckVolModifiable to see if a volume can be written to.
  3928. °dONLNd¥,H8n*1pascal OSErr UTCheckVolModifiable(short vRefNum);
  3929. °dONLNdÊCHOw*vRefNum°dONLNdÓC¥On)l%Contains the volume reference number.°dONLNdaHmÎ(jHUUTCheckVolModifiable checks the volume’s vcbAtrb field in its VCB to determine if the°dONLNdjmHy* )volume is locked by hardware or software.°dONLNdîçTôê+   Result codes°dONLNd°ôg•Ç+ noErr°dONLNdßôˆ•¸)è0°dONLNd©ô•D)%No error°dONLNd≤•g±ä(ÆgwPrErr°dONLNdπ•ϱ¸)Ö-44°dONLNdΩ•±Â)/)The volume is write protected by hardware°dONLNdÁ±gΩî(∫gvLckdErr°dONLNd±ÏΩ¸)Ö-46°dONLNdÙ±Ωª)/ The volume is locked by software(ÒH3-)
  3930. 42)&The Macintosh Volume Cacheˇ ædˇ ˇˇˇˇd
  3931. d,Times
  3932. .(2Ä The File System Utility Routines,     Helvetica
  3933. °dONLNdU`d(``UTCheckFileModifiable d^d§
  3934. °dONLNdq`}Ä*=Use UTCheckFileModifiable to see if a file can be written to.,
  3935. Courier
  3936. °dONLNdTä`ñû*5pascal OSErr UTCheckFileModifiable(short fileRefNum);
  3937. °dONLNdä°`≠ò*
  3938. fileRefNum°dONLNdï°Ã≠r)l#Contains the file reference number.°dONLNdπø`À(»`VUTCheckFileModifiable checks the volume’s vcbAtrb field in its VCB to determine if the°dONLNdÀ`◊* Xvolume is locked by hardware or software and checks the file's fcbFlags in its FCBRec to°dONLNdi◊`„¯* Xdetermine if the file can be written to through the access path specified by fileRefNum.°dONLNd¬˜l®+   Result codes°dONLNdœö+ noErr°dONLNd’)è0°dONLNd◊3\)%No error°dONLNd‡¢(wPrErr°dONLNdÁ)Ö-44°dONLNdÎ3˝)/)The volume is write protected by hardware°dONLNd'¨($vLckdErr°dONLNd')Ö-46°dONLNd"3'”)/ The volume is locked by software°dONLNdC'3¥(0    wrPermErr°dONLNdM'3)Ö-61°dONLNdQ'33Ó)/(The file access path does not have write°dONLNd}33?g*
  3939. permission
  3940. °dONLNdàa`p⁄(l`UTCheckDirBusy p^p§
  3941. °dONLNdó}`â∏*FUse UTCheckDirBusy to see if a directory is an open working directory.
  3942. °dONLNdfiñ`¢í*3pascal OSErr UTCheckDirBusy(VCBPtr volCtrlBlockPtr,°dONLNd¢Æì+µ unsigned long dirID);
  3943. °dONLNd0π`≈´(¬`volCtrlBlockPtr°dONLNd@πÃ≈˙)l@Contains a VCBPtr that specifies the volume the directory is on.°dONLNdÅÕ`Ÿy(÷`dirID°dONLNdáÕßG)lContains the directory ID.°dONLNd¢Î`˜ı(Ù`SUTCheckDirBusy checks to see if the directory specified by dirID is an open working°dONLNdˆ˜`^* 5directory on the volume specified by volCtrlBlockPtr.°dONLNd,l#®+   Result codes°dONLNd9#/ö+ noErr°dONLNd?#/)è0°dONLNdA#3/\)%No error°dONLNdJ/;•(8fBsyErr°dONLNdR/;)Ö-47°dONLNdV/3;˝)/*The directory is an open working directory
  3944. °dONLNdÅ]`l◊(h`UTDetermineVol l^l§
  3945. °dONLNdêy`Ö*TUse UTDetermineVol to determine what volume a parameter block refers to and how that°dONLNdÂÖ`ë÷* determination was made.
  3946. °dONLNd˝û`™Ê*Apascal OSErr UTDetermineVol(ParmBlkPtr paramBlock, short *status,°dONLNdG™∂á+µ short *moreMatches,
  3947. °dONLNdZ™á∂ä)r 
  3948. °dONLNd[™ä∂‰)short *vRefNum,°dONLNds∂¬´(øVCBPtr *volCtrlBlockPtr);
  3949. +I2The Macintosh Volume Cache)ß3-)
  3950. 43ˇdˇ ˇˇˇˇd
  3951. d,Times
  3952. .+H2 Guide to the File System Manager°dONLNdUHaÅ*,
  3953. paramBlock°dONLNd U¥aÆ)l6Contains a pointer to the parameter block to evaluate.°dONLNdBiHuc(rHstatus°dONLNdIi¥uÎ)lAContains a pointer to a short. UTDetermineVol places the decisive°dONLNdãu¥ÅÒ* Bfactor used to determine what volume paramBlock refers to into the°dONLNdŒÅ¥çÁ* Dfield referred to by this parameter. The status values returned are:°dONLNdçÿô    +$     dtmvError°dONLNdçDôT)l= 0°dONLNd#çhôÎ)$could not determine volume°dONLNd?ôÿ•+(¢ÿdtmvFullPathame°dONLNdOôD•T)l= 1°dONLNdSôh•Ó)$determined by full pathname°dONLNdp•ÿ±!(Æÿ dtmvVRefNum°dONLNd|•D±T)l= 2°dONLNdÄ•h±—)$determined by volume°dONLNdõ±hΩ∫* reference number°dONLNd≠Ωÿ…,(Δÿ dtmvWDRefNum°dONLNd∫ΩD…T)l= 3°dONLNdæΩh…÷)$determined by working°dONLNd⁄…h’Á* directory reference number°dONLNdˆ’ÿ·"(fiÿ dtmvDriveNum°dONLNd’D·T)l= 4°dONLNd’h·Ì)$determined by drive number°dONLNd#·ÿÌ(Íÿ dtmvDefault°dONLNd0·DÌT)l= 5°dONLNd4·hÌÙ)$determined by default volume°dONLNdQıHá(˛H moreMatches°dONLNd]ı¥Ó)lCContains a pointer to a short. If the volume was determined by full°dONLNd°¥
  3954. Û* =pathname and more than one mounted volume has the volume name°dONLNdfl
  3955. ¥˝* Apassed by paramBlock, UTDetermineVol places a non-zero value (the°dONLNd!¥%ˇ* Hlength of the volume name) into the field referred to by this parameter.°dONLNdj%¥1Ó* DThe value returned the field referred to by this parameter should be°dONLNdØ1¥=w* )ignored if status is not dtmvFullPathame.°dONLNdŸEHQw(NHvRefNum°dONLNd·E¥QË)l?Contains a pointer to a short. UTDetermineVol places the volume°dONLNd!Q¥]–* >reference number into the field referred to by this parameter.°dONLNdaeHqì(nHvolCtrlBlockPtr°dONLNdqe¥q˝)lCContains a pointer to an VCBPtr. UTDetermineVol places a pointer to°dONLNdµq¥}ß* 5the VCB into the field referred to by this parameter.°dONLNdÎèHõ‰(òHRUTDetermineVol uses the parameter block pointed to by paramBlock to determine what°dONLNd>õHßÈ* Xvolume to use and returns the decisive factor used to determine the volume. The decisive°dONLNdóßH≥¯* \factor used to determine the volume along with the other contents of the parameter block are°dONLNdÙ≥Høj* Aused to find the file or directory the parameter block refers to.°dONLNd6ÀH◊≤*IUTDetermineVol determines the volume by searching in the following order:°dONLNdÄ„TÔZ+ 1°dONLNdÇ„aÔË)
  3956. QFull pathname - This method is used if ioNamePtr is not NULL and points to a full°dONLNd‘Ôa˚Ú* Wpathname (see Inside Macintosh: Files for the definition of a full pathname). The first°dONLNd,˚a˘* Ucomponent of the pathname pointed to by the ioNamePtr field in the parameter block is°dONLNdÇaÒ* Oused as the volume name and UTDetermineVol attempts to find the volume by name.°dONLNd“T+Z((T2°dONLNd‘a+Ù)
  3957. RReference number - The ioVRefNum field in the parameter block is used to determine°dONLNd'+a7* Tthe volume. If ioVRefNum is zero, UTDetermineVol attempts to find the default volume°dONLNd|7aC* W(if the default volume is set up). If ioVRefNum is positive, UTDetermineVol attempts to°dONLNd‘CaOÎ* Ofind the volume by drive number. If ioVRefNum is negative, UTDetermineVol first°dONLNd    $Oa[Œ* Nattempts to find the volume by volume reference number and it that fails, then°dONLNd    s[agÒ* PUTDetermineVol attempts to find the volume by working directory reference number,
  3958.  
  3959. Zapf Dingbats
  3960. °dONLNd    ≈sT_(}Ts°dONLNd    «tfÄö)Warning:°dONLNd    œtöÄÈ)4C  The PBGetCatInfo and PBGetFInfo File Manager calls do not use the°dONLNd
  3961. Äfå‡(âfPioNamePtr field in a parameter block as an input when the ioFDirIndex field in a°dONLNd
  3962. dåfò‚* Nparameter block is non-zero. Before calling UTDetermineVol in these cases, you°dONLNd
  3963. ≥òf§∞* Bmust save the value of ioNamePtr and set ioNamePtr to NULL so that°dONLNd
  3964. ˆ§f∞Ë* OUTDetermineVol will not attempt to determine the volume by full pathname. After°dONLNd F∞fºÃ* Jcalling UTDetermineVol, you must restore the original value in ioNamePtr. 
  3965.     °dONLNd ê≤ê‘(πÃs
  3966. (ÒH3-)
  3967. 44)&The Macintosh Volume Cacheˇ ∞dˇ ˇˇˇˇd
  3968. d,Times
  3969. .(2Ä The File System Utility Routines°dONLNdU`a    (^`XIf the volume cannot be determined, UTDetermineVol will fail with paramErr and the field°dONLNdYa`mw* =referred to by the status parameter will be set to dtmvError.°dONLNdóÅlç®+   Result codes°dONLNd§çôö+ noErr°dONLNd™çô)è0°dONLNd¨ç3ô\)%No error°dONLNdµô•´(¢paramErr°dONLNdæô•)Ö-50°dONLNd¬ô3•Î)/'The parameter block does not refer to a°dONLNdÌ•3±Ç* mounted volume,     Helvetica
  3970. °dONLNd¸”`‚Ë(fi`UTParsePathname ‚^‚§
  3971. °dONLNd Ô`˚*\Use UTParsePathname to detemine if a pathname is valid, if the pathname is a partial or full°dONLNdi˚`Ω* Hpathname, and the volume name length if the pathname is a full pathname.,
  3972. Courier
  3973. °dONLNd≤` *Fpascal OSErr UTParsePathname(short *volNamelength, StringPtr namePtr);
  3974. °dONLNd˘+`7®*
  3975. volNamelength°dONLNd+Ã7˚)lBContains a pointer to a short. If the pathname is a full pathname,°dONLNdJ7ÃC* CUTParsePathname places the length of the volume name into the field°dONLNdéCÃO* Ereferred to by this parameter. If the pathname is a partial pathname,°dONLNd‘OÃ[* >UTParsePathname places zero into the field referred to by this°dONLNd[Ãg˛*
  3976. parameter.°dONLNdo`{á(x`namePtr°dONLNd&oÃ{˙)lBContains a pointer to a Pascal string that specifies the pathname.°dONLNdiç`ô(ñ`VUTParsePathname determines if namePtr points to a valid pathname, if the pathname is a°dONLNd¿ô`•* \partial or full pathname, and the volume name length if the pathname is a full pathname. See°dONLNd•`±* [Inside Macintosh: Files for the definition of a full and partial pathnames. UTParsePathname°dONLNdy±`Ω∑* Fcannot parse pathnames with more than 31 consecutive colon separators.°dONLNd¿—l›®+   Result codes°dONLNdÕ›Èö+ noErr°dONLNd”›È)è0°dONLNd’›3È\)%No error°dONLNdfiÈı±(ÚbdNamErr°dONLNdÁÈı)Ö-37°dONLNdÎÈ3ı)/)namePtr is NULL, namePtr points to a zero°dONLNdı3* 0length string, the pathname doesn’t have correct°dONLNdL3
  3977. ÿ* !syntax, or pathname has more than°dONLNdq
  3978. 3…* 31 consecutive colon separators
  3979. °dONLNdí;`J-(F`UTGetPathComponentName J^J§
  3980. °dONLNd©W`cº*AUse UTGetPathComponentName to parse the components in a pathname.
  3981. °dONLNdÎp`|‘*>pascal OSErr UTGetPathComponentName(ParsePathRecPtr parseRec);
  3982. °dONLNd*á`ìã*parseRec°dONLNd3áÃì~)l%Contains a pointer to a ParsePathRec.+íaThe Macintosh Volume Cache)ß3-)
  3983. 45ˇ
  3984. dˇ ˇˇˇˇd
  3985. d,Times
  3986. .+H2 Guide to the File System Manager°dONLNdiTuá+ @parseRec,    Symbol°dONLNd    uTÜ`*ưdONLNd ygÖé)namePtr°dONLNdyÿÖ)q    StringPtr°dONLNdy;Ö¯)c*Contains a pointer to a Pascal string that°dONLNdLÜ;íß*
  3987. contains the pathname.°dONLNdcíT£`(üTưdONLNdeñg¢ò) startOffset°dONLNdqñÿ¢)qshort°dONLNdwñ;¢Í)c%Contains the offset into the pathname°dONLNd°£;ØÓ*
  3988. &where the parsing will begin. Offset 0°dONLNdÃØ;ªÿ* %(not 1) is the first character of the°dONLNdˆª;«l*     pathname.°dONLNd«Tÿ`(‘T¨°dONLNdÀg◊º)componentLength°dONLNdÀÿ◊)qshort°dONLNdÀ;◊ı)c!UTGetPathComponentName places the°dONLNd>ÿ;‰Ú*
  3989. (length of the component into this field.°dONLNdg‰Tı`(ÒT¨°dONLNdiËgÙõ)moreName°dONLNdrËÿÙ)qshort°dONLNdxË;ÙÏ)c'If there is no more pathname left after°dONLNd§ı;ı*
  3990. !the parse, UTGetPathComponentName°dONLNd ;
  3991. * )places zero into this field; otherwise, a°dONLNd¯
  3992. ;Ú* )non-zero value is placed into this field.°dONLNd"T*`(&T¨°dONLNd$g)Æ)foundDelimiter°dONLNd3ÿ))qshort°dONLNd9;)Ì)c'If parsing stops because a delimiter (a°dONLNde*;6¥*
  3993. colon character) is found,°dONLNdÑ6;BÏ* UTGetPathComponentName places a°dONLNd®B;N≈* non-zero value into this field;°dONLNdÃN;Zı* *otherwise, zero is placed into this field.°dONLNd˜jHvˆ(sHSUTGetPathComponentName parses a pathname to get the individual components that make°dONLNdKvHÇô* up the pathname.°dONLNd\éHö˘*TThe namePtr field in the ParsePathRec passed to UTGetPathComponentName must point to°dONLNd±öH¶ä* Fthe pathname to parse. The startOffset field in the ParsePathRec tells°dONLNd¯¶H≤ø* GUTGetPathComponentName where to start looking for a pathname component.°dONLNd@æH ◊*PUTGetPathComponentName returns the length of the component at startOffset in the°dONLNdë H÷‡* VcomponentLength field of the ParsePathRec, indicates if the parse found the end of the°dONLNdË÷H‚Ê* Vpathname in the moreName field of the ParsePathRec, and indicates if the parse stopped°dONLNd?‚HÓ* (because a delimiter character was found.°dONLNdhTê+   Result codes°dONLNdugÇ+ noErr°dONLNd{ˆ¸)è0°dONLNd}D)%No error°dONLNdÜg&ô(#gbdNamErr°dONLNdèÏ&¸)Ö-37°dONLNdì&È)/)namePtr is NULL, namePtr points to a zero°dONLNd¿&2˝* 0length string, the pathname doesn’t have correct°dONLNdÙ2>¿* !syntax, or pathname has more than°dONLNd>J±* 31 consecutive colon separators,     Helvetica
  3994. °dONLNd:lH{û(wH
  3995. UTGetBlock {F{å
  3996. °dONLNdEàHîí*BUse UTGetBlock to get a cache block in the Macintosh volume cache.,
  3997. Courier
  3998. °dONLNdà°H≠ò*8pascal OSErr UTGetBlock(short refNum, void *log2PhyProc,°dONLNd»≠flπi+ó unsigned long blockNum,
  3999. °dONLNdfl≠iπl)ä 
  4000. °dONLNd‡≠lπΔ)short gbOption,°dONLNd˜πfl≈-(¬fl
  4001. Ptr *buffer);
  4002. (ÒH3-)
  4003. 46)&The Macintosh Volume Cacheˇ‰dˇ ˇˇˇˇd
  4004. d,Times
  4005. .(2Ä The File System Utility Routines°dONLNdU`aÖ(^`refNum°dONLNdUÃa•)l-Contains the file or volume reference number.°dONLNd5i`uû(r` log2PhyProc°dONLNdAiÃuı)l@Contains a pointer to the logical to physical routine or NULL if°dONLNdÇuÃÅå* &refNum is a volume refererence number.°dONLNd©â`ïí(í`blockNum°dONLNd≤âÃï)lDContains the logical block number of the file, or the physical block°dONLNd˜ïð8* number of the volume.°dONLNd
  4006. ©`µå(≤`gbOption°dONLNd©Ãµ
  4007. )lCContains the get block options. The option values you can pass are:°dONLNd[µ¡+$     gbDefault°dONLNdeµ8¡˝)H+read from disk if block is not found in the°dONLNdï¡8ÕR* cache°dONLNdúÕŸ(÷gbRead°dONLNd£Õ8Ÿ˛)H)always read block from disk (forced read)°dONLNdŒŸÂ(‚gbExist°dONLNd÷Ÿ8Â
  4008. )H1get block only if it is already in the cache as a°dONLNd Â8Ò* released block.°dONLNdÒ˝#(˙gbNoRead°dONLNd&Ò8˝¸)H-do not read block if it is not already in the°dONLNdX˝8    R* cache°dONLNd_     (    gbRelease°dONLNdi    8)H,this option can be added to any of the other°dONLNdö8!* *gbOptions to release the block immediately°dONLNd…!8-y* after getting it°dONLNd⁄5`A}(>`buffer°dONLNd·5ÃA)lDContains a pointer to a Ptr. UTGetBlock places the memory address of°dONLNd&AÃMfi* =the cache block into the field referred to by this parameter.°dONLNdd_`k(h`ZUTGetBlock gets a cache block in the Macintosh volume cache and returns the address of the°dONLNdøk`w* Ycache block in the buffer parameter. If refNum is a volume reference number, the blockNum°dONLNdw`É* Yis the physical block on the volume.  If refNum is a file reference number, then GetBlock°dONLNdsÉ`è* \calls the logical to physical routine to map blockNum, the logical file block, to a physical°dONLNd–è`õƒ* block on the volume.°dONLNdÂß`≥¿*HUTGetBlock lets you specify several options with the gbOption parameter:°dONLNd.ølÀp+ •°dONLNd0øyÀ)
  4009. WgbDefault should be used to get a disk block from the cache if it’s in the cache, or to°dONLNdàÀy◊z* ;bring a disk block into the cache if it isn’t in the cache.°dONLNdƒ„lÔp(Ïl•°dONLNdΔ„yÔ)
  4010. RgbRead should be used to force a block to be read from from the disk. For example,°dONLNdÔy˚* Tyou’d use the gbRead option when handling a _Read call where the read-verify mode is°dONLNdn˚yÊ* requested by the caller.°dONLNdálp(l•°dONLNdây˘)
  4011. NgbNoRead should be used to get a cache block who’s contents will be completely°dONLNdÿy+≥* overwritten.°dONLNdÂ7lCp(@l•°dONLNdÁ7yC)
  4012. WgbExist should be used for getting a disk block which should already be in the cache as°dONLNd?CyO€* Na released block. A free cache blocks is not found if gbExist is specified. If°dONLNdéOy[Ú* KUTGetBlock with the gbExists option fails, use UTBlockInFQHashP to see if a°dONLNd⁄[yg* Wphysical block on the volume is in a free cache block in the Macintosh volume cache and°dONLNd2gysj* 2if so, retry UTGetBlock with the gbDefault option.°dONLNdelãp(àl•°dONLNdgyã)
  4013. OgbRelease can be added to any of the other gbOptions to release the cache block°dONLNd∑ãyó÷* Mimmediately after getting it. This saves the step of releasing the block with°dONLNd    óy£ * NUTReleaseBlock when you know you won’t be making another call to the Macintosh°dONLNd    T£yØ˛* PVolume Cache (which could reuse the cache block) before the cache block is used.+ÂEThe Macintosh Volume Cache)ß3-)
  4014. 47ˇ
  4015. Ódˇ ˇˇˇˇd
  4016. d,Times
  4017. .+H2 Guide to the File System Manager°dONLNdaTmØ+ 8Important note: °dONLNdaØmÂ)[CUTGetBlock can potentially return an internal positive error result°dONLNdTmTyfl(vTVcode. Because the file system should never return a positive result, your foreign file°dONLNd´yTÖ”* Ssystem should return ioErr if it cannot recover gracefully from one of the positive°dONLNdˇÖTëë* error results.,
  4018.  
  4019. Zapf Dingbats
  4020. °dONLNd£TØ_*s°dONLNd§f∞ö)Warning:°dONLNd§ö∞È)4E  UTGetBlock may only be called from a foreign file system handling a°dONLNd^∞fºÕ(πfIrequest through its HFSCIProc. Attempts to call UTGetBlock outside of the°dONLNd®ºf»c* 4context of the HFSCIProc will cause a system crash. 
  4021.     °dONLNd‹æc«k)˝s
  4022. °dONLNdfi‚TÓê(ÎT Result codes°dONLNdÎÓg˙Ç+ noErr°dONLNdÒÓˆ˙¸)è0°dONLNdÛÓ˙D)%No error°dONLNd¸˙gì(gchNoBuf°dONLNd˙ˆ¸)è1°dONLNd˙˜)%1Cache internal error - no free cache buffers (all°dONLNd;G*     reserved)°dONLNdEgè(gchInUse°dONLNdMˆ¸)è2°dONLNdO◊)%)Cache internal error - requested block is°dONLNd|*C* reserved°dONLNdÖ*g6†(3g
  4023. chNotfound°dONLNdê*ˆ6¸)è3°dONLNdí*6Ù)%.Cache internal error - requested block was not°dONLNdƒ6B©* found (only if gbExist option)°dONLNd„BgN(KgioErr°dONLNdÈBÏN¸)Ö-36°dONLNdÌBNg)/Device I/O error°dONLNd˛NgZî(Wg    offLinErr°dONLNdNÏZ¸)Ö-65°dONLNd NZs)/Device was offline°dONLNdZgf“(cgnotEnoughMemoryErr°dONLNd2ZÊf¸)-620°dONLNd7Zf”)5#VM was not able to hold down enough°dONLNd^frl* physical memory,     Helvetica
  4024. °dONLNdnîH£ø(üHUTReleaseBlock £F£å
  4025. °dONLNd}∞HºN*5Use UTReleaseBlock to release a reserved cache block.,
  4026. Courier
  4027. °dONLNd≥…H’ò*8pascal OSErr UTReleaseBlock(Ptr buffer, short rbOption);
  4028. °dONLNdχHÏe*buffer°dONLNdÛ‡¥Ïî)l1Contains a pointer to the cache block to release.°dONLNd%ÙHr(˝HrbOption°dONLNd.Ù¥)lBContains the release block options. The option values you can pass°dONLNdq¥ ≈* are:°dONLNdw ÿ+$     rbDefault°dONLNdÅ  ã)Hrelease the cache block°dONLNdöÿ$¸(!ÿrbWrite°dONLNd¢ $Õ)H&release, write the cache block to disk°dONLNdÕ$ 0* .(forced write) - this will also mark the cache°dONLNd0 <U* block clean°dONLNd
  4029. <ÿH˝(EÿrbTrash°dONLNd< H®)Hmark the cache block trashed°dONLNd3HÿT˙(QÿrbDirty°dONLNd;H T”)H&release and mark the cache block dirty°dONLNdfT `j* (deferred write)°dONLNdx`ÿl˜(iÿrbFree°dONLNdÄ` lò)Hmark the cache block free°dONLNdö~HäÍ(áHWUTReleaseBlock releases the reserved cache block specified in the buffer parameter. The°dONLNdÚäHñÛ* XrbOption parameter also allows UTReleaseBlock to write the cache block to disk, mark the°dONLNdKñH¢v* Bcache block dirty, free the cache block, or trash the cache block.*R3-)
  4030. 48)&The Macintosh Volume Cacheˇpdˇ ˇˇˇˇd
  4031. d,Times
  4032. .(2Ä The File System Utility Routines°dONLNdalm«(jlImportant note: °dONLNda«mÛ)[@UTReleaseBlock can potentially return an internal positive error°dONLNdQmly(vlXresult code. Because the file system should never return a positive result, your foreign°dONLNd™ylÖˆ* Wfile system should return ioErr if it cannot recover gracefully from the positive error°dONLNdÖlëä* result.,
  4033.  
  4034. Zapf Dingbats
  4035. °dONLNd
  4036. £lØw*s°dONLNd §~∞≤)Warning:°dONLNd§≤∞‡)4>  UTReleaseBlock may only be called from a foreign file system°dONLNdS∞~ºÈ(π~Ihandling a request through its HFSCIProc. Attempts to call UTReleaseBlock°dONLNdùº~»æ* Coutside of the context of the HFSCIProc will cause a system crash. 
  4037.     °dONLNd‡ææ«Δ(≈æs
  4038. °dONLNd‚‚lÓ®(Îl Result codes°dONLNdÔÓ˙ö+ noErr°dONLNdıÓ˙)è0°dONLNd˜Ó3˙\)%No error°dONLNd˙π(
  4039. chNotInUse°dONLNd ˙)è1°dONLNd
  4040. ˙3)%/Cache internal error - block being released was°dONLNd@3a*
  4041. not in use°dONLNdKó(ioErr°dONLNdQ)Ö-36°dONLNdU3Ò)/)Device I/O error (only if rbWrite option)°dONLNd*¨('    offLinErr°dONLNdâ*)Ö-65°dONLNdç3*˝)/+Device was offline (only if rbWrite option)°dONLNdπ*6Í(3notEnoughMemoryErr°dONLNdÃ*˛6)-620°dONLNd—*36Î)5#VM was not able to hold down enough°dONLNd¯63Bˆ* (physical memory (only if rbWrite option),     Helvetica
  4042. °dONLNd!d`sÀ(o` UTFlushCache s^s§
  4043. °dONLNd.Ä`åÁ*RUse UTFlushCache to flush all dirty cache blocks associated with a file or volume.,
  4044. Courier
  4045. °dONLNdÅô`•∞*8pascal OSErr UTFlushCache(short refNum, short fcOption);
  4046. °dONLNd∫∞`ºÖ*refNum°dONLNd¡∞ú•)l-Contains the file or volume reference number.°dONLNdÔƒ`–â(Õ`fcOption°dONLNd¯ƒÃ–)lEContains the flush block options. The option values you can pass are:°dONLNd?–‹+$     fcDefault°dONLNdI–8‹†)Hflush the cache blocks°dONLNda‹Ë(ÂfcTrash°dONLNdi‹8Ë)H,mark the cache blocks trashed after flushing°dONLNdöË8ÙO* them°dONLNd†Ù(˝fcFree°dONLNd®Ù8˜)H)mark the cache blocks free after flushing°dONLNd÷8 O* them°dONLNd€`*Û('`UUTFlushCache flushes all dirty blocks associated with the file or volume specified by°dONLNd1*`6* ZrefNum. The fcOption parameter also allows UTFlushCache to free the cache blocks, or trash°dONLNdå6`B
  4047. * %the cache blocks after flushing them.°dONLNd≤NlZè+ Note: °dONLNd∏NèZÚ)#KWhen the fcTrash or fcFree option is used, all cache blocks associated with°dONLNdZlf„(clSthe file or volume are trashed or freed - not just those blocks that were dirty and°dONLNdXflrì* flushed.
  4048. °dONLNdaÑlêw*s°dONLNdcÖ~ë≤)Warning:°dONLNdkÖ≤ëÿ)4<  UTFlushCache may only be called from a foreign file system°dONLNd®ë~ù·(ö~Ghandling a request through its HFSCIProc. Attempts to call UTFlushCache°dONLNdù~©æ* Coutside of the context of the HFSCIProc will cause a system crash. 
  4049.     °dONLNd3üæ®Δ(¶æs
  4050. (Ò^The Macintosh Volume Cache)ß3-)
  4051. 49ˇ    ‡dˇ ˇˇˇˇd
  4052. d,Times
  4053. .+H2 Guide to the File System Manager°dONLNdUTaê+ , Result codes°dONLNd
  4054. agmÇ+ noErr°dONLNdaˆm¸)è0°dONLNdamD)%No error,     Helvetica
  4055. °dONLNdèHû£(öH UTMarkDirty ûFûå
  4056. °dONLNd*´H∑%*,Use UTMarkDirty to mark a cache block dirty.,
  4057. Courier
  4058. °dONLNdWƒH–&*%pascal OSErr UTMarkDirty(Ptr buffer);
  4059. °dONLNd}€HÁe*buffer°dONLNdÑ€¥Á•)l4Contains a pointer to the cache block to mark dirty.°dONLNdπ˘H>(H2UTMarkDirty marks the specified cache block dirty.°dONLNdÏT%ê+   Result codes°dONLNd˘%g1Ç+ noErr°dONLNdˇ%ˆ1¸)è0°dONLNd%1D)%No error
  4060. °dONLNd
  4061. SHbÕ(^HUTTrashVolBlocks bFbå
  4062. °dONLNdoH{˜*XUse UTTrashVolBlocks to trash all file and volume cache blocks associated with a volume.
  4063. °dONLNdtàHîå*6pascal OSErr UTTrashVolBlocks(VCBPtr volCtrlBlockPtr);
  4064. °dONLNd´üH´ì*volCtrlBlockPtr°dONLNdªü¥´ä)l,Contains a VCBPtr that specifies the volume.°dONLNdËΩH…‰(ΔHTUTTrashVolBlocks trashes all file and volume cache blocks associated with the volume°dONLNd=…H’„* Yspecified by volCtrlBlockPtr. That includes all released blocks and all free blocks. This°dONLNdó’H·l* ;routine must be used when a volume is unmounted or ejected.°dONLNd”ıTê+   Result codes°dONLNd‡g
  4065. Ç+ noErr°dONLNdʈ
  4066. ¸)è0°dONLNdË
  4067. D)%No error
  4068. °dONLNdÒ/H>—(:HUTTrashFileBlocks >F>å
  4069. °dONLNdKHWò*GUse UTTrashFileBlocks to trash all cache blocks associated with a file.
  4070. °dONLNdKdHpå*6pascal OSErr UTTrashFileBlocks(VCBPtr volCtrlBlockPtr,°dONLNdãp |§+ÿ unsigned long fileNum)
  4071. °dONLNd¢áHìì(êHvolCtrlBlockPtr°dONLNd≤á¥ì«)l;Contains a VCBPtr that specifies the volume the file is on.°dONLNdÓõHßo(§HfileNum°dONLNdˆõ¥ßG)l Contains the file’s file number.°dONLNdπH≈˙(¬H[UTTrashFileBlocks trashes all cache blocks associated with the file specified by fileNum on°dONLNds≈H—ˇ* _the volume specified by volCtrlBlockPtr. This routine is typically used when a file is deleted.*#3-)
  4072. 50)&The Macintosh Volume Cacheˇ dˇ ˇˇˇˇd
  4073. d,Times
  4074. .(2Ä The File System Utility Routines°dONLNdUla®(^l Result codes°dONLNd
  4075. amö+ noErr°dONLNdam)è0°dONLNda3m\)%No error,     Helvetica
  4076. °dONLNdè`ûŒ(ö`
  4077. UTTrashBlocks û^û§
  4078. °dONLNd,´`∑‰*RUse UTTrashBlocks to trash or free a range of cache blocks associated with a file.,
  4079. Courier
  4080. °dONLNdƒ`–™*7pascal OSErr UTTrashBlocks(unsigned long beginPosition,°dONLNdø–‹•+µ unsigned long byteCount,°dONLNd‡‹Ë * )VCBPtr volCtrlBlockPtr, short fileRefNum,°dONLNdËÙo* short tbOption)
  4081. °dONLNd"ˇ` °(`
  4082. beginPosition°dONLNd0ˇÃ „)l<Contains the beginning byte position of the blocks to trash.°dONLNdm î* .beginPosition must be a multiple of 512 bytes.°dONLNdú`+ë((`    byteCount°dONLNd¶Ã+)lCContains the number of bytes to trash. byteCount must be a multiple°dONLNdÍ+Ã7 *
  4083. of 512 bytes.°dONLNd¯?`K´(H`volCtrlBlockPtr°dONLNd?ÃKfl)l;Contains a VCBPtr that specifies the volume the file is on.°dONLNdDS`_ò(\`
  4084. fileRefNum°dONLNdOSÃ_{)l%Contains the file’s reference number.°dONLNdug`sâ(p`tbOption°dONLNd~gÃs¯)lBContains the trash block options.  If zero, the range of blocks if°dONLNd¡sÑ* 9trashed; If non-zero, the range of blocks is marked free.°dONLNd˚ë`ù(ö`\UTTrashBlocks trashes or frees a range of cache blocks associated with the file specified by°dONLNdXù`©Â* PfileRefNum on the volume specified by volCtrlBlockPtr. The range is specified by°dONLNd©©`µÔ* UbeginPosition and byteCount. This routine is typically used when a file is shortened.°dONLNdˇ…l’®+   Result codes°dONLNd ’·ö+ noErr°dONLNd’·)è0°dONLNd’3·\)%No error
  4085. °dONLNd`ÿ(`
  4086. UTCacheReadIP ^§
  4087. °dONLNd+`+*RUse UTCacheReadIP to read a consecutive number of blocks into the caller’s buffer.
  4088. °dONLNd~8`Dn*-pascal OSErr UTCacheReadIP(void *log2PhyProc,°dONLNd¥DP∑+µ unsigned long filePosition,°dONLNdÿP\œ* Ptr ioBuffer, short fileRefNum,°dONLNd\hü* unsigned long reqCount,°dONLNd ht•* unsigned long *actCount,°dONLNdAtÄá* short cacheOption);
  4089. °dONLNdUã`óû(î` log2PhyProc°dONLNdaãÃóÎ)l>Contains a pointer to the logical to physical mapping routine.°dONLNd†ü`´ñ(®` filePosition°dONLNd≠üô)lIContains the position in bytes to start reading from. This must fall on a°dONLNd˜´Ã∑¢* -512-byte boundary (i.e., 0, 512, 1024, etc.).°dONLNd%ø`Àà(»`ioBuffer°dONLNd.øÃÀÈ)l>Contains a pointer to data buffer where the data will be read.+í)The Macintosh Volume Cache)ß3-)
  4090. 51ˇ&dˇ ˇˇˇˇd
  4091. d,Times
  4092. .+H2 Guide to the File System Manager°dONLNdUHaÄ*,
  4093. fileRefNum°dONLNd U¥aZ)l#Contains the file reference number.°dONLNd/iHut(rHreqCount°dONLNd8i¥u˘)lDContains the number of bytes to read. This must be a multiple of 512°dONLNd}u¥Å—* bytes.°dONLNdÑâHïr(íHactCount°dONLNdçâ¥ïÚ)l@Contains a pointer to an unsigned long. UTCacheReadIP places the°dONLNdŒï¥°¸* Hactual number of bytes read into the field referred to by this parameter°dONLNd°¥≠∏* .°dONLNdµH¡Ç(æH cacheOption°dONLNd%µ¥¡”)l=Contains the cache options. The valid bits in the cacheOption°dONLNdc¡¥Õˆ* parameter are:°dONLNdsÕÿŸ+$ noCache°dONLNd{Õ Ÿ°)Hplease don’t cache this read°dONLNdôŸÿÂ(‚ÿrdVerify°dONLNd¢Ÿ ÂÎ)H*always read blocks from disk (forced read)°dONLNdÕ˜HÓ(HXUTCacheReadIP lets you request a multiple-block read from a file through the file system°dONLNd&H¸* Tcache mechanism. UTCacheReadIP always reads a contiguous range of blocks. The number°dONLNd{H·* Vof contiguous blocks actually read is determined by the log2PhyProc and is returned in°dONLNd“H'v*     actCount.°dONLNd‹3H?Ì*YThe cacheOption parameter lets you request that reads not be cached, or that reads always°dONLNd6?HKœ* Rcome from the disk. A foreign file system handling a _Read call can simply use the°dONLNdâKHWÃ* OioPosMode word from the caller’s parameter block for the cacheOption parameter.°dONLNdŸcToØ+ Important note: °dONLNdÈcØo€)[?UTCacheReadIP can potentially return an internal positive error°dONLNd)oT{Í(xTXresult code. Because the file system should never return a positive result, your foreign°dONLNdÇ{TáÂ* Xfile system should return ioErr if it cannot recover gracefully from one of the positive°dONLNd€áTìë* error results.,
  4094.  
  4095. Zapf Dingbats
  4096. °dONLNdÍ•T±_*s°dONLNd϶f≤ö)Warning:°dONLNdÙ¶ö≤»)4=  UTCacheReadIP may only be called from a foreign file system°dONLNd2≤fæ—(ªfHhandling a request through its HFSCIProc. Attempts to call UTCacheReadIP°dONLNd{æf ¶* Coutside of the context of the HFSCIProc will cause a system crash. 
  4097.     °dONLNdæ¿¶…Æ(«¶s
  4098. °dONLNd¿‰Tê(ÌT Result codes°dONLNdÕg¸Ç+ noErr°dONLNd”ˆ¸¸)è0°dONLNd’¸D)%No error°dONLNdfi¸gì(gchNoBuf°dONLNdʸˆ¸)è1°dONLNd˸˜)%1Cache internal error - no free cache buffers (all°dONLNdG*     reserved)°dONLNd'g è(gchInUse°dONLNd/ˆ ¸)è2°dONLNd1 ◊)%)Cache internal error - requested block is°dONLNd^ ,C* reserved°dONLNdg,g8†(5g
  4099. chNotfound°dONLNdr,ˆ8¸)è3°dONLNdt,8Ù)%.Cache internal error - requested block was not°dONLNd¶8D©* found (only if gbExist option)°dONLNd≈DgP(MgioErr°dONLNdÀDÏP¸)Ö-36°dONLNdœDPg)/Device I/O error°dONLNd‡Pg\î(Yg    offLinErr°dONLNdÍPÏ\¸)Ö-65°dONLNdÓP\s)/Device was offline°dONLNd\gh“(egnotEnoughMemoryErr°dONLNd\Êh¸)-620°dONLNd\h”)5#VM was not able to hold down enough°dONLNd@htl* physical memory,     Helvetica
  4100. °dONLNdPñH•¿(°HUTCacheWriteIP •F•å
  4101. °dONLNd_≤Hæ„*TUse UTCacheWriteIP to write a consecutive number of blocks from the caller’s buffer.*63-)
  4102. 52)&The Macintosh Volume Cacheˇ Ãdˇ ˇˇˇˇd
  4103. d,Times
  4104. .(2Ä The File System Utility Routines,
  4105. Courier
  4106. °dONLNdU`at(^`.pascal OSErr UTCacheWriteIP(void *log2PhyProc,°dONLNd7am +µ )unsigned long filePosition, Ptr ioBuffer,°dONLNdimy * )short fileRefNum, unsigned long reqCount,°dONLNdõyÖ•* unsigned long *actCount,°dONLNdºÖëá* short cacheOption);
  4107. °dONLNd–ú`®û(•` log2PhyProc°dONLNd‹úîÎ)l>Contains a pointer to the logical to physical mapping routine.°dONLNd∞`ºñ(π` filePosition°dONLNd(∞ú )lGContains the position in bytes to start writing to. This must fall on a°dONLNdpºÃ»¢* -512-byte boundary (i.e., 0, 512, 1024, etc.).°dONLNdû–`‹à(Ÿ`ioBuffer°dONLNdߖË√)l6Contains a pointer to data buffer containing the data.°dONLNdfi‰`ò(Ì`
  4108. fileRefNum°dONLNdȉÃr)l#Contains the file reference number.°dONLNd
  4109. ¯`å(`reqCount°dONLNd¯Ã)lEContains the number of bytes to write. This must be a multiple of 512°dONLNd\ÃÈ* bytes.°dONLNdc`$ä(!`actCount°dONLNdlÃ$ )lAContains a pointer to an unsigned long. UTCacheWriteIP places the°dONLNdÆ$Ã0* Aactual number of bytes written into the field referred to by this°dONLNd0Ã<* parameter .°dONLNd¸D`Pö(M` cacheOption°dONLNdDÃPÎ)l=Contains the cache options. The valid bits in the cacheOption°dONLNdFPÃ\* parameter are:°dONLNdV\h+$ noCache°dONLNd^\8hΩ)Hplease don’t cache this write°dONLNd|z`ܲ(É`XUTCacheWriteIP lets you request a multiple-block write to a file through the file system°dONLNd’Ü`í* Vcache mechanism. UTCacheWriteIP always writes a contiguous range of blocks. The number°dONLNd,í`û* Yof contiguous blocks actually written is determined by the log2PhyProc and is returned in°dONLNdÜû`™é*     actCount.°dONLNdê∂`¬*[The cacheOption parameter lets you request that writes not be cached. A foreign file system°dONLNdϬ`Œ* Zhandling a _Write call can simply use the ioPosMode word from the caller’s parameter block°dONLNdGŒ`⁄Ò* for the cacheOption parameter.°dONLNdfÊlÚ«+ Important note: °dONLNdvÊ«Úı)[@UTCacheWriteIP can potentially return an internal positive error°dONLNd∑Úl˛(˚lXresult code. Because the file system should never return a positive result, your foreign°dONLNd˛l
  4110. ˝* Xfile system should return ioErr if it cannot recover gracefully from one of the positive°dONLNdi
  4111. l©* error results.,
  4112.  
  4113. Zapf Dingbats
  4114. °dONLNdx(l4w*s°dONLNdz)~5≤)Warning:°dONLNdÇ)≤5‚)4>  UTCacheWriteIP may only be called from a foreign file system°dONLNd¡5~AÎ(>~Ihandling a request through its HFSCIProc. Attempts to call UTCacheWriteIP°dONLNd A~Mæ* Coutside of the context of the HFSCIProc will cause a system crash. 
  4115.     °dONLNdNCæLΔ(Jæs
  4116. (Ò^The Macintosh Volume Cache)ß3-)
  4117. 53ˇ
  4118. 6dˇ ˇˇˇˇd
  4119. d,Times
  4120. .+H2 Guide to the File System Manager°dONLNdiTuê+ @ Result codes°dONLNd
  4121. ugÅÇ+ noErr°dONLNduˆÅ¸)è0°dONLNduÅD)%No error°dONLNdÅgçì(ägchNoBuf°dONLNd&ňç¸)è1°dONLNd(Åç˜)%1Cache internal error - no free cache buffers (all°dONLNd]çôG*     reserved)°dONLNdgôg•è(¢gchInUse°dONLNdoôˆ•¸)è2°dONLNdqô•◊)%)Cache internal error - requested block is°dONLNdû•±C* reserved°dONLNdß±gΩ†(∫g
  4122. chNotfound°dONLNd≤±ˆΩ¸)è3°dONLNd¥±ΩÙ)%.Cache internal error - requested block was not°dONLNdÊΩ…©* found (only if gbExist option)°dONLNd…g’(“gioErr°dONLNd …Ï’¸)Ö-36°dONLNd…’g)/Device I/O error°dONLNd ’g·î(fig    offLinErr°dONLNd*’Ï·¸)Ö-65°dONLNd.’·s)/Device was offline°dONLNdA·gÌ“(ÍgnotEnoughMemoryErr°dONLNdT·Ê̸)-620°dONLNdY·Ì”)5#VM was not able to hold down enough°dONLNdÄÌ˘l* physical memory,     Helvetica
  4123. °dONLNdêH*◊(&HUTBlockInFQHashP *F*å
  4124. °dONLNd°7HC˙*YUse UTBlockInFQHashP to see if a physical block on the volume is in a free cache block in°dONLNd˚CHO—* the Macintosh volume cache.,
  4125. Courier
  4126. °dONLNd\HhÏ*Fpascal OSErr UTBlockInFQHashP(short vRefNum, unsigned long diskBlock);
  4127. °dONLNd^sHw*vRefNum°dONLNdfs¥n)l%Contains the volume reference number.°dONLNdåáHìx(êH    diskBlock°dONLNdñá¥ì•)l1Contains the physical block number of the volume.°dONLNd»•H±(ÆH]UTBlockInFQHashP lets you check to see if the specified block is in a free cache block in the°dONLNd&±HΩÓ* UMacintosh volume cache. UTBlockInFQHashP returns noErr if the disk block data is in a°dONLNd|ΩH…˙* _free cache block. A result of chNotfound indicates that the disk block is not in the free block°dONLNd‹…H’â* Equeue (although it may in the cache as a reserved or released block).°dONLNd"ÈTıê+   Result codes°dONLNd/ıgÇ+ noErr°dONLNd5ıˆ¸)è0°dONLNd7ıD)%No error°dONLNd@g
  4128. †(
  4129. g
  4130. chNotfound°dONLNdKˆ
  4131. ¸)è3°dONLNdM
  4132. ‚)%)Requested block was not found in the free°dONLNdz
  4133. T* block queue(ÒH3-)
  4134. 54)&The Macintosh Volume Cacheˇdˇ ˇˇˇˇd
  4135. d,     Helvetica
  4136. .°dONLNdV`hk+`d4°dONLNdVÑh¯)$!THE DISK INITIALIZATION COMPONENT Q^Q°dONLNd$lÑ~Û*    INTERFACE ~^~,Times
  4137. (Ú
  4138. 4-)
  4139. 1ˇ
  4140. :dˇ ˇˇˇˇd
  4141. d,Times
  4142. .+H3 Guide to the File System Manager,     Helvetica
  4143. °dONLNdUHdÚ*-ABOUT THIS CHAPTER NFN gFg
  4144. °dONLNd~Hä*'_This chapter describes the Disk Initialization Package component interface, the data structures°dONLNdsäHñ* _used by the Disk Initialization Package component interface, and the routines your foreign file°dONLNd”ñH¢≠* Ksystem must provide to the Disk Initialization Package component interface.°dONLNdÆH∫Ê*YTo use this chapter, you should be familiar with the information in the chapter “The File°dONLNdy∫HΔK* 5System Manager” in this document, the information in °dONLNdÆ∫KΔπ(√KInside Macintosh: Files°dONLNd≈∫πΔŒ)n, the°dONLNdÀΔH“é(œHinformation in °dONLNd⁄Δé“
  4145. )FInside Macintosh: Devices°dONLNdÛΔ
  4146. “ı)|1, and the information in the Technical Note “What°dONLNd%“Hfiœ(€HYour Sony Drives for You”.
  4147. °dONLNd@H˜*3/ABOUT THE DISK INITIALIZATION PACKAGE COMPONENT ¸F¸°dONLNdpH*†*    INTERFACE -F-
  4148. °dONLNdzDHPÙ*'[The Disk Initialization Package component interface allows a foreign file system to process°dONLNd÷PH\„* ZDisk Initialization Package requests and allows a foreign file system to describe its disk°dONLNd1\HhÌ* Zinitialization services to the File System Manager. Whenever a Disk Initialization Package°dONLNdåhHtÛ* [request is made, the File System Manager will call the foreign file system through the Disk°dONLNdËtHĈ* ]Initialization Package component interface to get additional information and request specific°dONLNdFÄHåm* actions.
  4149. °dONLNdO±H¿Û*3/USING THE DISK INITIALIZATION PACKAGE COMPONENT ™F™°dONLNd…Hÿ†*    INTERFACE €F€
  4150. °dONLNdâÚH˛∞*'This section describes°dONLNd†
  4151. TX+ •°dONLNd¢
  4152. av)
  4153. :the Disk Initialization Package Component Interface record°dONLNd›"T.X(+T•°dONLNdfl"a.¸)
  4154. Wthe Disk Initialization Package Component Interface request processing function and its°dONLNd7.a:¥* function selectors
  4155. °dONLNdJRHa˘(]H:The Disk Initialization Package Component Interface Record aFa
  4156. °dONLNdÖnHzÊ*WThe Disk Initialization Package component interface record in an File System Descriptor°dONLNd›zHÜ* `record lets the foreign file system tell the Disk Initialization Package component interface how°dONLNd>ÜHíÎ* ^to dispatch Disk Initialization Package requests to the foreign file system. It tells the Disk°dONLNdùíHûÁ* ZInitialization Package component interface where the routine to handle Disk Initialization°dONLNd¯ûH™* YPackage requests is in memory, the maximum length of volume names the foreign file system°dONLNdR™H∂* ^can accept, and the disk block size of your foreign file system’s volume format. The data type°dONLNd±∂H¬Ø* KDICIRec defines the Disk Initialization Package component interface record.*34-)
  4157. 2)&9Using the Disk Initialization Package Component Interfaceˇ§dˇ ˇˇˇˇd
  4158. d,Times
  4159. .(383The Disk Initialization Package Component Interface,
  4160. Courier
  4161. °dONLNdUlaÃ(^lstruct DICIRec {°dONLNdaäm¢+ long°dONLNda˘mS)ocompInterfMask;°dONLNd&anmÏ)u/* component flags */°dONLNd<mäy¥(väDICIUPP°dONLNdDm˘yS)ocompInterfProc;°dONLNdTmnyÏ)u/* pointer to request°dONLNdoyÄÖÏ+ processing code */°dONLNdÇÖäë®(éäshort°dONLNdàÖ˘ë_)omaxVolNameLength;°dONLNdöÖnë)u/* maximum length of your°dONLNdπëÄù‘+ volume name */°dONLNd»ùä©fi(¶äunsigned short°dONLNd◊ù˘©5)o
  4162. blockSize;°dONLNd‚ùn©)u/* your file system's block°dONLNd©ĵ™+ size */°dONLNd µä¡¢(æälong°dONLNdµ˘¡5)o
  4163. reserved3;°dONLNdµn¡Ú)u/* --reserved, must be°dONLNd7¡ÄÕ∂+     zero-- */°dONLNdAÕ䟢(÷älong°dONLNdFÕ˘Ÿ5)o
  4164. reserved2;°dONLNdQÕnŸÚ)u/* --reserved, must be°dONLNdmŸÄÂ∂+     zero-- */°dONLNdwÂäÒ¢(Óälong°dONLNd|¢Ò5)o
  4165. reserved1;°dONLNdáÂnÒÚ)u/* --reserved, must be°dONLNd£ÒÄ˝∂+     zero-- */°dONLNd≠˝ä    ñ(ä};°dONLNd∞    äD* typedef struct DICIRec DICIRec;°dONLNd–ä!2* typedef DICIRec *DICIRecPtr;
  4166. °dONLNdÌ2`>Δ(;`Field descriptions°dONLNdL`XÆ*compInterfMask°dONLNdLÃX)lEContains the Disk Initialization Package component interface dispatch°dONLNdUXÃd©* /mask. Currently the following bits are defined:°dONLNdÖdÃp›* Bit°dONLNdädwpß)´Meaning°dONLNdípÃ|“(yÃ0°dONLNdîpÁ|) diCILiveBit°dONLNd†pw|)êIf set, this file system is a°dONLNd¡|wàÈ* candidate for the current°dONLNdfiàwî
  4167. * !formatting operation. This bit is°dONLNdîw†„* maintained by the Disk°dONLNd†w¨€* Initialization Package°dONLNd7¨w∏⁄* component interface.°dONLNdL∏Â(¡Ã1-15°dONLNdR∏wƒß)´    Reserved.°dONLNd\ƒÃ–ÿ(ÕÃ16°dONLNd_ƒÁ–G)diCIDoesSparingBit°dONLNdrƒw–˚)ê Set this bit if the foreign file°dONLNdñ–w‹ * system supports bad block disk°dONLNd∏‹wËû* sparing.°dONLNd¡ËÃÙÿ(ÒÃ17°dONLNdƒËÁÙd)diCIHasMultiVolTypesBit°dONLNd‹ËwÙ˚)ê Set this bit if the foreign file°dONLNdÙw
  4168. * system supports more than one°dONLNd!w µ* volume type.°dONLNd. Ãÿ(Ã18°dONLNd1 Ár)diCIHasExtFormatParamsBit°dONLNdK w˚)ê Set this bit if the foreign file°dONLNdow$ˇ* system uses extended format°dONLNdé$w0Æ* parameters.°dONLNdö0Ã<Ë(9Ã19-23°dONLNd†0w<ß)´    Reserved.°dONLNd™<ÃHË(EÃ24-29°dONLNd∞<wH)´Reserved for the File System°dONLNd–HwT¿* Manager’s use.°dONLNdflTÃ`ÿ(]Ã30°dONLNd‚TÁ`W)fsmComponentBusyBit°dONLNdˆTw`ˆ)êIf set, the FSM component°dONLNd`wl* interface is busy (i.e., one or°dONLNd6lwx * more requests are outstanding).°dONLNdYxwѸ* This bit is maintained by the°dONLNdzÑwê
  4169. * component and used by the File°dONLNdúêwú* System Manager to control the°dONLNdΩúw®Ó* use of the SetFSInfo File°dONLNd⁄®w¥* System Manager service request.(Úÿ9Using the Disk Initialization Package Component Interface(Ú 4-)
  4170. 3ˇTdˇ ˇˇˇˇd
  4171. d,Times
  4172. .+H3 Guide to the File System Manager°dONLNda¥m¿+l731°dONLNdaœmF)fsmComponentEnableBit°dONLNda_m˜)êIf set, the component may begin°dONLNd<m_y* #dispatching requests to the foreign°dONLNdcy_Ö‚* file system. The foreign file°dONLNdÑÖ_ëÓ* system should set this bit with°dONLNdßë_ù‹* the SetFSInfo File System°dONLNdƒù_©* #Manager service request once it  is°dONLNdΩ_µ◊* ready to receive requests.°dONLNdΩH…í(ΔHcompInterfProc°dONLNdΩ∏…Â)pCContains a pointer to the foreign file system’s Disk Initialization°dONLNdY…∏’ * 8Package component interface request processing function.°dONLNdí›HÈ™(ÊHmaxVolNameLength°dONLNd£›∏È·)p<Contains the maximum length of volume names the foreign file°dONLNd‡È∏ı* system can accept.°dONLNdÛ˝H    v(H    blockSize°dONLNd˝˝∏    ·)pAContains the size of the foreign file system disk block in bytes.,     Helvetica
  4173. °dONLNd?'H6(2H;The Disk Initialization Package Component Interface Request°dONLNd{5HD€*Processing Function DFD
  4174. °dONLNdèQH]˜*ZThe Disk Initialization Package Component Interface request processing function pointed to°dONLNdÍ]HiŸ* Rby compInterfProc in a DICIRec is called by the File System Manager to handle Disk°dONLNd=iHu˙* \Initialization Package requests. The Disk Initialization Package Component Interface request°dONLNdöuHÅ8* 1processing function must have the following form.,
  4175. Courier
  4176. °dONLNdÃéHö™*;pascal OSErr DICIProc(short whatFunction, void *paramBlock,°dONLNdöfl¶W+ó void *fsdGlobalPtr);
  4177. °dONLNd$±HΩâ(∫H whatFunction°dONLNd1±¥Ωˇ)lEContains a selector number which indicates what operation the foreign°dONLNdwΩ¥….* file system must perform.°dONLNdë—H›Å(⁄H
  4178. paramBlock°dONLNdú—¥›Œ)l<Contains a pointer to the parameter block passed to the Disk°dONLNdŸ›¥È’* =Initialization Package component interface request processing°dONLNdÈ¥ıfl* Afunction. The contents of the parameter block are specific to the°dONLNdYı¥&* selector number passed.°dONLNdq    HÖ(H fsdGlobalPtr°dONLNd~    ¥Í)lDContains a pointer to the foreign file system’s optional global data°dONLNd√¥!À* area.°dONLNd…3H?Ó(<HZWhen the foreign file system’s DICIProc is called, it is passed a function selector number°dONLNd$?HK„* Ywhich specifies the operation to perform, a pointer to a buffer containing any additional°dONLNd~KHW˜* ]parameters needed to process the operation, and a pointer to the foreign file system’s global°dONLNd‹WHcz* Bdata area. The currently defined messages are listed in Table 4-1.°dONLNdoH{g*Table
  4179.     °dONLNd$pg{i) 
  4180. °dONLNd%oi{Å)4-1.°dONLNd*oê{Œ)'BDisk Initialization Package Component Interface Function Selectors°dONLNdmÜHíx(èHMessage°dONLNduÜ·í)ôPurpose F°dONLNd}ûH™u(ßHdiCILoad°dONLNdÜû–™÷)à1°dONLNdàû‚™ˆ)=Load the disk initialization code and data resources (if they°dONLNdΔ™‚∂fl* 3are not loaded or purged) and make them unpurgable.(ÚH4-)
  4181. 4)&9Using the Disk Initialization Package Component Interfaceˇ ¸dˇ ˇˇˇˇd
  4182. d,Times
  4183. .(383The Disk Initialization Package Component Interface°dONLNda`mò(j`
  4184. diCIUnload°dONLNd aËmÓ)à2°dONLNd
  4185. a˙mÎ)4Make the disk initialization code and data resources°dONLNdBm˙y'*     purgable.°dONLNdMÖ`ë◊(é`diCIEvaluateSizeChoices°dONLNdeÖËëÓ)à3°dONLNdgÖ˙ë)ADetermine if the foreign file system can initialize a disk in the°dONLNd©ë˙ùC* specified drive.°dONLNdª©`µ∑(≤`diCIExtendedZero°dONLNdé˵Ó)à4°dONLNdŒ©˙µÈ)4Initialize a disk (write an empty volume directory).°dONLNd¡`Õ»( `diCIValidateVolName°dONLNd¡ËÕÓ)à5°dONLNd¡˙Õß)$Determine if a volume name is valid.°dONLNd@Ÿ`Â√(‚`diCIGetVolTypeInfo°dONLNdSŸËÂÓ)à6°dONLNdUŸ˙Â)8If the foreign file system supports more than one volume°dONLNdéÂ˙Ò¡* +type, provide a list of those volume types.°dONLNdª˝`    ≈(`diCIGetFormatString°dONLNdœ˝Ë    Ó)à7°dONLNd—˝˙     )7Supply strings used to build the Format pop-up menu and°dONLNd        ˙˚* 9help balloons used in the disk initialization dialog box.°dONLNdD!`-€(*`diCIGetExtFormatParams°dONLNd[!Ë-Ó)à8°dONLNd]!˙-)=Query the user (or another part of the system) for additional°dONLNdõ-˙9* 7formatting information beyond that supplied by the disk°dONLNd”9˙E * =initialization dialog box provided by the Disk Initialization°dONLNdE˙Q%* Package.°dONLNd]`i(f`YHow the foreign file system’s DICIProc should handle each operation and what result codes°dONLNdui`ut* ;should be returned are described in the following sections.°dONLNd±Ålçã+ Note:°dONLNd∂Åãçˆ)J The DICIProc cannot be called at interrupt time. Thus, it may make Memory°dONLNdçlôî(ñl;Manager requests and synchronous operating system requests.,     Helvetica
  4186. °dONLNd=±`¿°(º`diCILoad
  4187. °dONLNdFÀ`◊*aThe diCILoad function selector tells the foreign file system to load the disk initialization code°dONLNd®◊`„Ò* Sand data resources (if they are not loaded or purged) and make them unpurgable. The°dONLNd¸„`ÔÆ* EparamBlock parameter is not used with the diCILoad function selector.°dONLNdBl®+   Result codes°dONLNdOö+ noErr°dONLNdU)è0°dONLNdW3\)%No error°dONLNd`'
  4188. ($Qany of the result codes returned by the Resource Manager, GetFSInfo, or SetFSInfo
  4189. °dONLNd≤C`R∞(N`
  4190. diCIUnload
  4191. °dONLNdΩ]`i *^The diCIUnload function selector tells the foreign file system to make the disk initialization°dONLNdi`u·* Ocode and data resources purgable. The paramBlock parameter is not used with the°dONLNdlu`ÅÌ* diCIUnload function selector.°dONLNdäïl°®+   Result codes°dONLNdó°≠ö+ noErr°dONLNdù°≠)è0°dONLNdü°3≠\)%No error(Úÿ9Using the Disk Initialization Package Component Interface(Ú 4-)
  4192. 5ˇ¬dˇ ˇˇˇˇd
  4193. d,Times
  4194. .+H3 Guide to the File System Manager,     Helvetica
  4195. °dONLNdUHd˝*-diCIEvaluateSizeChoices
  4196. °dONLNdoH{˙*]The diCIEvaluateSizeChoices function selector allows a foreign file system to determine if it°dONLNdv{Há˚* acan initialize a disk in the specified drive. If the disk drive can format disks in more than one°dONLNdÿáHìÓ* ]size, the foreign file system indicates what sizes it can support and the preferred size. The°dONLNd6ìHüt* <paramBlock parameter points to a DICIEvaluateSizeRec record.°dONLNds≥TøÕ+  DICIEvaluateSizeRec,    Symbol°dONLNdáøT–`*¨°dONLNdâ√gœ∂)defaultSizeIndex°dONLNdö√Δœfi)_short°dONLNd†√œ÷)Q)The foreign file system returns the index°dONLNdŒ–‹Ú*
  4197. .number of the preferred or default SizeListRec°dONLNd‹Ë‰* 0in this field; the first SizeListRec is at index°dONLNd6ËÙÓ* .position 1. If none of the SizeListRec records°dONLNdiÙÍ* 0contain a valid size choice for the foreign file°dONLNdû v* system, return zero.°dONLNd≥ T`(TưdONLNdµg±)numSizeEntries°dONLNdƒΔfi)_short°dONLNd Û)Q-Contains the number of SizeListRec records in°dONLNd¸)∫*
  4198. $the array pointed to by sizeListPtr.°dONLNd!)T:`(6TưdONLNd#-g9¶) driveNumber°dONLNd/-Δ9fi)_short°dONLNd5-9ò)QContains the drive number.°dONLNdP:TK`(GTưdONLNdR>gJô) sizeListPtr°dONLNd^>ΔJ )_SizeListRecPtr°dONLNdm>JØ)Q!Contains a pointer to an array of°dONLNdìKWy*
  4199. SizeListRec records.°dONLNd®WTh`(dTưdONLNd™[ggó)
  4200. sectorSize°dONLNdµ[Δg )_unsigned short°dONLNdƒ[g”)Q'Contains the number of bytes per sector°dONLNdht„*
  4201. +(sectors may not be the same size as blocks°dONLNd tÄÌ* .used by a foreign file system). Use this value°dONLNdSÄåfi* ,to help determine if the foreign file system°dONLNdÑåòƒ* $can use disks mounted on this drive.°dONLNd©®H¥Ù(±H[The sizeListPtr field in the DICIEvaluateSizeRec points to an array of SizeListRec records.°dONLNd»T‘ó+   SizeListRec°dONLNd‘TÂ`*¨°dONLNdÿg‰•)
  4202. sizeListFlags°dONLNd!ÿΔ‰fi)_short°dONLNd'ÿ‰fl)Q-The foreign file system returns the size list°dONLNdYÂÒ¯*
  4203. 4flags in this field. All bits are currently reserved°dONLNdíÒ˝8* except:°dONLNdû˝     z+     diCISizeListOKBit°dONLNd∞˝å    Ó)lSet this bit if the size°dONLNd—    åÒ* specified in sizeEntry°dONLNdå!Ê* can be used by this°dONLNd !å-Ë* foreign file system.°dONLNd!-T>`(:TưdONLNd#1g=ì)    sizeEntry°dONLNd-1Δ= )_
  4204. FormatListRec°dONLNd;1=Ê)Q*Contains a FormatListRec which specifies a°dONLNdj>Jê*
  4205. possible size of the drive.°dONLNdÜZHfP(cH8The sizeEntry field in a SizeListRec is a FormatListRec.°dONLNdøzTÜß+  
  4206. FormatListRec°dONLNdÕÜTó`*ưdONLNdœägñä)volSize°dONLNd◊äΔñ    )_
  4207. unsigned long°dONLNdÂäñŸ)Q*Contains the disk capacity in disk sectors°dONLNdó£„*
  4208. +(sectors may not be the same size as blocks°dONLNdD£Øß* used by a foreign file system).(ÚH4-)
  4209. 6)&9Using the Disk Initialization Package Component Interfaceˇædˇ ˇˇˇˇd
  4210. d,Times
  4211. .(383The Disk Initialization Package Component Interface,    Symbol°dONLNdUlfx(blưdONLNdYe∏) formatFlags°dONLNdYfie)_
  4212. SignedByte°dONLNdY/eˆ)Q+Contains the format flags, density bit, and°dONLNdIf/r *
  4213.  number of disk sides. The sides,°dONLNdnr/~Á* (sectorsPerTrack, and tracks are valid if°dONLNdõ~/ä* -diCIFmtFlagsValidBit is set. The current disk°dONLNdÕä/ñ* ,has this format if diCIFmtFlagsCurrentBit is°dONLNd˛ñ/¢
  4214. * -set. The disk is double-density (.SONY driver°dONLNd0¢/Æ
  4215. * -only) if diCIFmtFlagsDoubleDensityBit is set.°dONLNdbÆ/∫
  4216. * .The low nibble of the byte contains the number°dONLNdï∫/Δo* of disk sides.°dONLNd®Δl◊x(”lưdONLNd™ ÷À)sectorsPerTrack°dONLNd∫ fi÷)_
  4217. SignedByte°dONLNd≈ /÷˚)Q*Contains the average number of sectors per°dONLNdÙ◊/„J*
  4218. track.°dONLNd˚„lÙx(lưdONLNd˝ÁÛõ)tracks°dONLNdÁfiÛ$)_unsigned short°dONLNdÁ/Ûÿ)Q#Contains the number of disk tracks.°dONLNd7`(
  4219. `YThe array of SizeListRec records is built from information obtained from the disk driver.°dONLNdë`* YSpecifically, the File System Manager obtains the SizeListRec records by calling the disk°dONLNdÎ`( * \driver’s _Status function with csCode set to Return Format List (6). If the disk driver does°dONLNdH(`4˛* Xnot support the Return Format List request, a single SizeListRec is constructed from the°dONLNd°4`@* 'information in the drive queue element.°dONLNd…L`X*ZThe foreign file system must index through the array of SizeListRec records. The number of°dONLNd$X`d* _elements in the array is indicated by numSizeEntries. If the foreign file system can format the°dONLNdÑd`p* _disk using the size specified by a particular SizeListRec, it sets the diCISizeListOKBit in the°dONLNd‰p`| * \SizeListRec’s sizeListFlags field. SizeListRec records usable by the foreign file system are°dONLNdA|`à≠* Fshown in the Format pop-up menu in the disk initialization dialog box.°dONLNdàî`†˚*VThe index of the preferred SizeListRec is returned in the DICIEvaluateSizeRec record’s°dONLNdfl†`¨* ^defaultSizeIndex field where defaultSizeIndex is in the range 1 to numSizeEntries. This is the°dONLNd>¨`∏¯* Vmenu item shown in the Format pop-up menu in the disk initialization dialog box if the°dONLNdï∏`ƒm* :current disk is already owned by this foreign file system.°dONLNd–ÿl‰®+   Result codes°dONLNd›‰ö+ noErr°dONLNd„‰)è0°dONLNd‰3\)%No error,     Helvetica
  4220. °dONLNdÓ `„(`diCIExtendedZero
  4221. °dONLNdˇ&`2*]The diCIExtendedZero function selector allows a foreign file system to initialize a disk. The°dONLNd]2`>í* <paramBlock parameter points to a DICIExtendedZeroRec record.°dONLNdöRl^Î+  DICIExtendedZeroRec°dONLNdÆ^lox*ưdONLNd∞bnæ) driveNumber°dONLNdºbfinˆ)_short°dONLNd¬b/n )Q-Contains the drive number of the device which°dONLNdÙo/{˘*
  4222. *should be initialized with an empty volume°dONLNd#{/áâ* directory structure.°dONLNd8álòx(îlưdONLNd:ãó∏)
  4223. volNamePtr°dONLNdEãfió    )_    StringPtr°dONLNdOã/ó    )Q.Contains a pointer to the name that the volume°dONLNdÇò/§~*
  4224. should be given.°dONLNdì§lµx(±lưdONLNdﮥë)fsid°dONLNdö®fi¥ˆ)_short°dONLNd†®/¥–)Q#Contains the target file system ID.(Úÿ9Using the Disk Initialization Package Component Interface(Ú 4-)
  4225. 7ˇ⁄dˇ ˇˇˇˇd
  4226. d,Times
  4227. .+H3 Guide to the File System Manager,    Symbol°dONLNdUTf`+ /ưdONLNdYge¥)volTypeSelector°dONLNdYΔefi)_short°dONLNdYeˆ)Q0Contains the volume type selector if the foreign°dONLNdMfr‚*
  4228. )file system supports more than one volume°dONLNd{r~÷* 'type (diCIHasMultiVolTypesBit is set in°dONLNdß~ä·* )the compInterfMask field of the DICIRec).°dONLNd—äTõ`(óTưdONLNd”égöª)numDefectBlocks°dONLNd„éΔö )_unsigned short°dONLNdÚéö‡)Q)Contains the number of bad disk blocks or°dONLNd õßÒ*
  4229. 1zero. The block size is the size specified in the°dONLNdVß≥¨* blockSize field of the DICIRec.°dONLNdv≥Tƒ`(¿TưdONLNdx∑g√©)defectListSize°dONLNdá∑Δ√ )_unsigned short°dONLNdñ∑√fl)Q.Contains the size of the defect list buffer if°dONLNd…ƒ–Ô*
  4230. ,numDefectBlocks is not zero. For example, if°dONLNd˙–‹ı* .the volume size is 800K and your file system’s°dONLNd-‹ËÚ* /block size is 1024 bytes, then defectListSize =°dONLNdaËÙÍ* .100 (800 bits = 100 bytes) and the defect list°dONLNdîÙï* buffer is 100 bytes in size.°dONLNd±T`(
  4231. TưdONLNd≥g£)
  4232. defectListPtr°dONLNd¡Δ‘)_Ptr°dONLNd≈‰)Q/Contains a pointer to the defect list buffer if°dONLNd˘ÿ*
  4233. 'numDefectBlocks is not zero. The buffer°dONLNd%)ı* 0contains a bitmap of the disk blocks. A zero bit°dONLNdY)5Ì* ,means the block is good, and a one bit means°dONLNdä5AÌ* 0the block is defective. This buffer is allocated°dONLNdøAM“* )by the Disk initialization Package and is°dONLNdÌMYÙ* 1released by the Disk initialization Package after°dONLNd#Yeô* returning from this request.°dONLNd@eTv`(rTưdONLNdBiguä)volSize°dONLNdJiΔu )_unsigned short°dONLNdYiuÚ)Q/Contains the size of the volume in disk sectors°dONLNdçvÇ„*
  4234. +(sectors may not be the same size as blocks°dONLNdΩÇéß* used by a foreign file system).°dONLNd›éTü`(õTưdONLNdflígûó)
  4235. sectorSize°dONLNdÍíΔû )_unsigned short°dONLNd˘íûÍ)Q,Contains the number of bytes per disk sector°dONLNd*ü´„*
  4236. +(sectors may not be the same size as blocks°dONLNdZ´∑ß* used by a foreign file system).°dONLNdz∑T»`(ƒTưdONLNd|ªg«≥)extendedInfoPtr°dONLNdåªΔ«‘)_Ptr°dONLNdꪫÓ)Q/Contains a pointer to the foreign file system’s°dONLNdƒ»‘Ω*
  4237. #extended formatting information (if°dONLNdÏ‘‡⁄* 'diCIHasExtFormatParamsBit is set in the°dONLNd‡Ï* -compInterfMask field of the DICIRec), or nil.°dONLNdF¸H£(HJThe foreign file system must initialize the disk specified by driveNumber.°dONLNdëH Ú*YIf the foreign file system has set diCIHasMultiVolTypesBit in the compInterfMask field of°dONLNdΠH,¯* \the DICIRec indicating that it supports multiple volume formats, the volume type selected is°dONLNdH,H8•* in volTypeSelector.°dONLNd\DHPÊ*XIf the foreign file system has set diCIDoesSparingBit in the compInterfMask field of the°dONLNdµPH\ˇ* \DICIRec, it can use the information in numDefectBlocks, defectListSize, and defectListPtr to°dONLNd\Hh…* perform bad block sparing.*ç4-)
  4238. 8)&9Using the Disk Initialization Package Component InterfaceˇDdˇ ˇˇˇˇd
  4239. d,Times
  4240. .(383The Disk Initialization Package Component Interface°dONLNdilu®(rl Result codes°dONLNd
  4241. uÅö+ noErr°dONLNduÅ)ì0°dONLNdu3Å\)!No error°dONLNdÅçˆ(ädiCICriticalSectorBadErr°dONLNd7Å ç)ç20°dONLNd:Å3ç)'.Disk cannot be spared; sectors critical to the°dONLNdlç3ôù* volume format are bad°dONLNdÇô•Â(¢diCISparingFailedErr°dONLNdóô •)ç21°dONLNdöô3•›)'$Disk cannot be spared; general error°dONLNdø•±(ÆdiCITooManyBadSectorsErr°dONLNdÿ• ±)ç22°dONLNd€•3±·)'#Disk cannot be spared; too many bad°dONLNd±3Ωç* sectors were found°dONLNdΩ…¸(ΔdiCIUnknownVolTypeErr°dONLNd+Ω …)ç23°dONLNd.Ω3…Ù)''The volume type passed is not supported°dONLNdV…’Á(“diCINoExtendInfoErr°dONLNdj… ’)ç27°dONLNdm…3’ˆ)'(extendedInfoPtr was required but nil was°dONLNdô’3·S* passed°dONLNd†·Ì´(ÍparamErr°dONLNd©·Ì)â-50°dONLNd≠·3Ì)+,The file system ID passed does not belong to°dONLNd›Ì3˘ü* this foreign file system,     Helvetica
  4242. °dONLNdˆ`$˘( `diCIValidateVolName
  4243. °dONLNd
  4244. /`;*XThe diCIValidateVolName function selector allows a foreign file system to determine if a°dONLNdc;`G˛* Qvolume name is valid. The paramBlock parameter points to a DICIValidateVolNameRec°dONLNdµG`SÇ* record.°dONLNdΩglsˇ+  DICIValidateVolNameRec,    Symbol°dONLNd‘slÑx*ưdONLNd÷wɧ)theChar°dONLNdfiwfiÉÚ)_char°dONLNd„w/ÉŒ)Q#Contains the character to validate.°dONLNdÑlïx(ël¨°dONLNd    àî◊)hasMessageBuffer°dONLNdàfiî)_Boolean°dONLNd"à/î
  4245. )Q2The foreign file system returns true in this field°dONLNdYï/°*
  4246. 0if it is providing its own alert message when an°dONLNdé°/≠* /illegal character is detected (messageBufferPtr°dONLNd¬≠/π}* must not be nil).°dONLNd‘πl x(ΔlưdONLNd÷Ω…∞)
  4247. charOffset°dONLNd·Ωfi…ˆ)_short°dONLNdÁΩ/…)Q.Contains the position of the current character°dONLNd /÷‘*
  4248. '(the first character is at position 1).°dONLNdB÷lÁy(„l´°dONLNdD⁄Ê‘)messageBufferPtr°dONLNdU⁄fiÊ    )_    StringPtr°dONLNd_⁄/Ê )Q1If messageBufferPtr is not nil, then it points to°dONLNdïÁ/Û*
  4249. -a Str255 buffer where the foreign file system°dONLNd«Û/ˇ* 0can return its own alert message when an illegal°dONLNd¸ˇ/ ë* character is detected.°dONLNd lx(lưdONLNd¡) charByteType°dONLNd"fiˆ)_short°dONLNd(/˚)Q,Contains the identity of theChar as a 1-byte°dONLNdY/(*
  4250. 4character or as the first or second byte of a 2-byte°dONLNdí(/4∑* character. The values can be:°dONLNd¥48@r+     smFirstByte°dONLNd¿4Ä@)H First byte of a 2-byte character°dONLNdÂ@8Lz(I8 smSingleByte°dONLNdÚ@ÄLÀ)H1-byte character°dONLNdL8Xp(U8
  4251. smLastByte°dONLNdLÄX)HSecond byte of 2-byte character°dONLNd5X/d(a/-smFirstByte, smSingleByte, and smLastByte are°dONLNdgd/pã* defined in Script.h.°dONLNd|Ä`å(â`YForeign file systems must be able to determine if a volume name is valid. The volume name°dONLNd÷å`òµ* must be validated:°dONLNdȧl∞p+ •°dONLNdΧy∞)
  4252. Yas characters are entered into the name field in the disk initialization dialog box. This°dONLNdE∞yº
  4253. * Wgives the foreign file system an opportunity to examine the syntax of the name as it is°dONLNdùºy»À* being assembled.+_-9Using the Disk Initialization Package Component Interface(Ú 4-)
  4254. 9ˇËdˇ ˇˇˇˇd
  4255. d,Times
  4256. .+H3 Guide to the File System Manager°dONLNdUTaX+ +•°dONLNdUaa)
  4257. Twhen the volume format selected in the Format pop-up menu in the disk initialization°dONLNdWaamÔ* Tdialog box changes. This gives the foreign file system an opportunity to examine the°dONLNd¨mayj* 9syntax of the name already entered in the the name field.°dONLNdÊÖTëX(éT•°dONLNdËÖaë˚)
  4258. Zwhen characters are pasted into the name field of the disk initialization dialog box. This°dONLNdCëaùÁ* Tgives the foreign file system an opportunity to examine the syntax of the characters°dONLNdòùa©∫* added to the name.°dONLNd´µH¡∫(æHRIf an illegal character is detected, the foreign file system must return paramErr.°dONLNd˛ÕHŸÛ*]If messageBufferPtr is not nil, then it points to Str255 buffer where the foreign file system°dONLNd\ŸHÂÛ* _can return its own alert message when an illegal character is detected. If an illegal character°dONLNdºÂHÒÛ* [alert message is supplied, the foreign file system must return true in the hasMessageBuffer°dONLNdÒH˝˝* bfield. If hasMessageBuffer is left false, the Disk Initialization Package uses the default illegal°dONLNd{˝H    ˇ* ^character alert message. The messageBufferPtr field is set to nil (no buffer is provided) when°dONLNd⁄    HÔ* Zthe volume format selected in the Format pop-up menu in the disk initialization dialog box°dONLNd5H!Ó* \changes and when characters are pasted into the name field of the disk initialization dialog°dONLNdí!H-^* box.°dONLNdó9HEô*FThe Disk Initialization Package ensures volume names are not too long.°dONLNdfiYTeê+   Result codes°dONLNdÎegqÇ+ noErr°dONLNdÒe˙q)ì0°dONLNdÛeqD)!No error°dONLNd¸qg}ì(zgparamErr°dONLNdq})â-50°dONLNd    q}Ï)+/The character passed is illegal in this foreign°dONLNd<}âû* file system’s volume names,     Helvetica
  4259. °dONLNdW•H¥÷(∞HdiCIGetVolTypeInfo
  4260. °dONLNdjøHÀÒ*XThe diCIGetVolTypeInfo function selector allows a foreign file system that supports more°dONLNd√ÀH◊Í* Vthan one volume type to provide a list of those volume types. The paramBlock parameter°dONLNd◊H„* )points to a DICIGetVolTypeInfoRec record.°dONLNdD˜T·+  DICIGetVolTypeInfoRec,    Symbol°dONLNdZT`*ưdONLNd\gä)volSize°dONLNddΔ    )_
  4261. unsigned long°dONLNdrŸ)Q*Contains the disk capacity in disk sectors°dONLNd° „*
  4262. +(sectors may not be the same size as blocks°dONLNd— ,ß* used by a foreign file system).°dONLNdÒ,T=`(9TưdONLNdÛ0g<ó)
  4263. sectorSize°dONLNd˛0Δ< )_unsigned short°dONLNd
  4264. 0<”)Q'Contains the number of bytes per sector°dONLNd9=I„*
  4265. +(sectors may not be the same size as blocks°dONLNdiIUß* used by a foreign file system).°dONLNdâUTf`(bT¨°dONLNdãYge™) numVolTypes°dONLNdóYΔefi)_short°dONLNdùYeÌ)Q-The foreign file system returns the number of°dONLNdœfr«*
  4266. 'volume types it supports in this field.°dONLNd˜rTÉ`(T¨°dONLNd˘vgÇ¿)volTypesBuffer[4]°dONLNd vΔLJ)_Str32°dONLNdvÇÁ)Q,The foreign file system returns the names of°dONLNdBÉèÒ*
  4267. 0volume types it supports in these string fields.(ÚH4-)
  4268. 10)&9Using the Disk Initialization Package Component InterfaceˇLdˇ ˇˇˇˇd
  4269. d,Times
  4270. .(383The Disk Initialization Package Component Interface°dONLNdU`a(^`VSome file systems support more than one volume type, for example Macintosh File System°dONLNdWa`m
  4271. * Vsupports both HFS and MFS volume types. If your foreign file system supports more than°dONLNdÆm`y* Yone volume type, it should set the diCIHasMultiVolTypesBit in the compInterfMask field of°dONLNdy`Ö˙* Wits DICIRec. If the diCIHasMultiVolTypesBit is not set, the Disk Initialization Package°dONLNd`Ö`ëƒ* KComponent Interface request processing function will not be called with the°dONLNd¨ë`ù* %diCIGetVolTypeInfo function selector.°dONLNd“©`µ*^The volSize and sectorSize fields are provided to help the foreign file system determine which°dONLNd1µ`¡¯*  of its volume types can be used.°dONLNdRÕ`Ÿ*YThe foreign file system returns the number of volume types it supports in the numVolTypes°dONLNd¨Ÿ`Â-* +field. Up to four volume types are allowed.°dONLNdÿÒ`˝*ZThe name of each supported volume type is returned in one of the four volTypeBuffer string°dONLNd3˝`    * ]buffers. These strings are used, together with the file system name and disk size, to compose°dONLNdë    `* ]the menu item strings to be displayed in the disk initialization dialog’s Format pop-up menu.°dONLNdÔ`!˘* WThe order of the strings is important because the ordering number will be passed as the°dONLNdG!`-˜* VvolTypeSelector to the foreign file system when it is called with the diCIExtendedZero°dONLNdû-`9* _function selector. The value of volTypeSelector is only meaningful to your file system as it is°dONLNd˛9`E * \a direct mapping to the types returned by this function request in the volTypesBuffer string°dONLNd[E`QÜ* buffers.°dONLNdd]`i*[Your foreign file system’s default volume type string must be returned in volTypesBuffer[1]°dONLNd¿i`u˙* Xfor that volume type to be selected as the default in the Format pop-up menu in the disk°dONLNdu`Å“* initialization dialog box.°dONLNd4ç`ô *XYour volume type information and the corresponding type selectors should be published in°dONLNdçô`•˛* Yyour foreign file system’s documentation so that specific volume types can be initialized°dONLNdÁ•`±Å* ;programmatically by applications with the DIXZero function.°dONLNd#≈l—®+   Result codes°dONLNd0—›ö+ noErr°dONLNd6—›)ì0°dONLNd8—3›\)!No error,     Helvetica
  4272. °dONLNdA˘`ˆ(`diCIGetFormatString
  4273. °dONLNdU`*XThe diCIGetFormatString function selector allows a foreign file system to supply strings°dONLNdÆ`+* ]used to build the Format pop-up menu and help balloons used in the disk initialization dialog°dONLNd +`7Œ* Hbox. The paramBlock parameter points to a DICIGetFormatStringRec record.°dONLNdUKlW¸+  DICIGetFormatStringRec,    Symbol°dONLNdlWlhx*ưdONLNdn[g¢)volSize°dONLNdv[fig!)_
  4274. unsigned long°dONLNdÑ[/gÒ)Q*Contains the disk capacity in disk sectors°dONLNd≥h/t˚*
  4275. +(sectors may not be the same size as blocks°dONLNd„t/Äø* used by a foreign file system).°dONLNd    Älëx(çlưdONLNd    ÑêØ)
  4276. sectorSize°dONLNd    Ñfiê$)_unsigned short°dONLNd    Ñ/êÎ)Q'Contains the number of bytes per sector°dONLNd    Kë/ù˚*
  4277. +(sectors may not be the same size as blocks°dONLNd    {ù/©ø* used by a foreign file system).(Úÿ9Using the Disk Initialization Package Component Interface(Ú4-)
  4278. 11ˇ dˇ ˇˇˇˇd
  4279. d,Times
  4280. .+H3 Guide to the File System Manager,    Symbol°dONLNdUTf`+ /ưdONLNdYge¥)volTypeSelector°dONLNdYΔefi)_short°dONLNdYeˆ)Q0Contains the volume type selector if the foreign°dONLNdMfr‚*
  4281. )file system supports more than one volume°dONLNd{r~÷* 'type (diCIHasMultiVolTypesBit is set in°dONLNdß~ä·* )the compInterfMask field of the DICIRec).°dONLNd—äTõ`(óTưdONLNd”égöö)
  4282. stringKind°dONLNdfiéΔöfi)_short°dONLNd‰éöfi)Q*Contains the kind of string requested. The°dONLNdõßE*
  4283. kinds are:°dONLNd"ß ≥è+     diCIAlternateFormatStr°dONLNd9ßô≥‚)yget the alternate°dONLNdQ≥ôø÷*
  4284. format string°dONLNdcø Àë(» diCISizePresentationStr°dONLNd{øôÀÕ)y get the size°dONLNdéÀô◊* presentation string°dONLNd¢◊TË`(‰T¨°dONLNd§€gÁ°) stringBuffer°dONLNd±€ΔÁÊ)_Str255°dONLNd∏€Á◊)Q*The foreign file system returns the string°dONLNdÁËÙÄ*
  4285. requested in this field.°dONLNdHÁ(
  4286. HVA foreign file system can supply strings used to build the Format pop-up menu and help°dONLNdWHˆ* _balloons used in the disk initialization dialog box. If the foreign file system doesn’t provide°dONLNd∑H(Û* [the string, it can return diCIUnknownDICallErr and Disk Initialization Package will use its°dONLNd(H4è* default strings.°dONLNd$@HL¸*_If stringKind is diCIAlternateFormatStr, the foreign file system can provide a string that will°dONLNdÑLHX˚* Ybe used augment the help balloon displayed for a volume type in the Format pop-up menu in°dONLNdfiXHd* athe disk initialization dialog box. For example, without the alternate format string, the balloon°dONLNd@dHp“* Ttext for an Macintosh 800K disk reads “To erase the selected disk and change it to a°dONLNdïpH|¯* \Macintosh 800K disk, choose this item, then click Erase.” With the alternate format string “°dONLNdÚ|HàÏ* V(also known as a double-sided Macintosh disk)”, the balloon text for an Macintosh 800K°dONLNdIàHî* \disk reads “To erase the selected disk and change it to a Macintosh 800K disk (also known as°dONLNd¶îH†â* Da double-sided Macintosh disk), choose this item, then click Erase.”°dONLNdΨH∏È*[If stringKind is diCISizePresentationStr, the foreign file system can provide a string that°dONLNdG∏Hƒ˝* ]replaces the volume type in the Format pop-up menu in the disk initialization dialog box. For°dONLNd•ƒH–˚* \example, by supplying the size presentation string, the volume type string in the Format pop°dONLNdƒ˚–ˇ(Õ˚-°dONLNd–H‹’(ŸHLup menu could be changed from “Macintosh 720K” to “Macintosh HFS Interchange°dONLNdO‹HËs* Format”.°dONLNdX¸Tê+   Result codes°dONLNdegÇ+ noErr°dONLNdk˙)ì0°dONLNdmD)!No error°dONLNdvg ⁄(gdiCIUnknownDICallErr°dONLNdãÙ )ç25°dONLNdé „)'+The requested string isn’t provided by this°dONLNdΩ ,s* foreign file system,     Helvetica
  4287. °dONLNd—HHW(SHdiCIGetExtFormatParams
  4288. °dONLNdËbHnÂ*UThe diCIGetExtFormatParams function selector allows a foreign file system a chance to°dONLNd>nHzÛ* [query the user (or another part of the system) for additional formatting information beyond°dONLNdözHÜ˝* `that supplied by the disk initialization dialog box provided by the Disk Initialization Package.°dONLNd˚ÜHí¨* EThe paramBlock parameter points to a DICIGetExtendedFormatRec record.°dONLNd    A¶T≤ı+  DICIGetExtendedFormatRec°dONLNd    Z≤T√`*ưdONLNd    \∂g¬¶) driveNumber°dONLNd    h∂Δ¬fi)_short°dONLNd    n∂¬Ì)Q-Contains the drive number of the device to be°dONLNd    †√œH*
  4289. initialized.(ÚH4-)
  4290. 12)&9Using the Disk Initialization Package Component Interfaceˇ®dˇ ˇˇˇˇd
  4291. d,Times
  4292. .(383The Disk Initialization Package Component Interface,    Symbol°dONLNdUlfx(blưdONLNdYeÃ)volTypeSelector°dONLNdYfieˆ)_short°dONLNdY/e)Q0Contains the volume type selector if the foreign°dONLNdMf/r˙*
  4293. )file system supports more than one volume°dONLNd{r/~Ó* 'type (diCIHasMultiVolTypesBit is set in°dONLNdß~/ä˘* )the compInterfMask field of the DICIRec).°dONLNd—älõx(ólưdONLNd”éö¢)volSize°dONLNd€éfiö!)_
  4294. unsigned long°dONLNdÈé/öÒ)Q*Contains the disk capacity in disk sectors°dONLNdõ/ß˚*
  4295. +(sectors may not be the same size as blocks°dONLNdHß/≥ø* used by a foreign file system).°dONLNdh≥lƒx(¿lưdONLNdj∑√Ø)
  4296. sectorSize°dONLNdu∑fi√$)_unsigned short°dONLNdÑ∑/√Î)Q'Contains the number of bytes per sector°dONLNd∞ƒ/–˚*
  4297. +(sectors may not be the same size as blocks°dONLNd‡–/‹ø* used by a foreign file system).°dONLNd‹lÌx(ÈlưdONLNd‡Ï÷)fileSystemSpecPtr°dONLNd‡fiÏ)_    FSSpecPtr°dONLNd‡/Ïı)Q+Contains a pointer to foreign file system’s°dONLNdNÌ/˘X*
  4298. FSSpec.°dONLNdV˘l
  4299. x(l¨°dONLNdX˝    À)extendedInfoPtr°dONLNdh˝fi    Ï)_Ptr°dONLNdl˝/        )Q0The foreign file system returns a pointer to the°dONLNd°
  4300. /*
  4301. .extended formatting information in this field.°dONLNd–&`2Ù(/`UA foreign file system may need more information from the user (or another part of the°dONLNd&2`>´* Gsystem) than can be provided by the disk initialization dialog box. The°dONLNdn>`J* [diCIGetExtFormatParams function selector allows a foreign file system a chance to query the°dONLNd J`V* auser for extended formatting information after the user selects the Erase or Initialize button in°dONLNd,V`b* ]the disk initialization dialog box. The diCIGetExtFormatParams function selector is called if°dONLNdäb`nÚ* Tthe diCIHasExtFormatParamsBit is set in the compInterfMask field of the foreign file°dONLNdfln`zª* system’s DICIRec.°dONLNdÒÜ`í*VWhen called with the diCIGetExtFormatParams function selector, the foreign file system°dONLNdHí`û * [should allocate memory (if it hasn’t done so when called with the diLoad function selector)°dONLNd§û`™
  4302. * Zfor the extended formatting information structure, open its resource fork using the FSSpec°dONLNdˇ™`∂* Zpassed in the fileSystemSpecPtr field, display one or more dialogs to collect the extended°dONLNdZ∂`¬˛* Zinformation, close its resource fork, and then return a pointer to the extended formatting°dONLNdµ¬`Œ* ^information in the extendedInfoPtr field. When called with the diUnload function selector, the°dONLNdŒ`⁄Ë* Tforeign file system should dispose of its extended formatting information structure.°dONLNdiÊ`Ú¸*UAny dialogs displayed should contain both a “Continue” and a “Cancel” button with the°dONLNdøÚ`˛* ^“Continue” button as the default selection. If the “Continue” button is selected, noErr should°dONLNd˛`
  4303. ˛* Ybe returned as the result along with the extended formatting information. If the “Cancel”°dONLNdx
  4304. `≠* Gbutton is selected, diCIUserCancelErr should be returned as the result.°dONLNd¿"`.*ZThe extended formatting information data structure used by your foreign file system should°dONLNd    .`:* [be documented so that application programs can pass the information programmatically in the°dONLNd    w:`F¥* DIXZero request.°dONLNd    àZlf®+   Result codes°dONLNd    ïfrö+ noErr°dONLNd    õfr)ì0°dONLNd    ùf3r\)!No error°dONLNd    ¶r~⁄({diCIUserCancelErr°dONLNd    ∏r~)ì1°dONLNd    ∫r3~)!,The “Cancel” button was selected by the user(Úÿ9Using the Disk Initialization Package Component Interface(Ú4-)
  4305. 13ˇdˇ ˇˇˇˇd
  4306. d,     Helvetica
  4307. .°dONLNdV`h€+`d APPENDIX A:°dONLNd Vhπ)êTHE EXTENDED DISK Q^Q°dONLNdl~Â*INITIALIZATION PACKAGE ~^~,Times
  4308. (ÚA-) 1ˇ
  4309. ƒdˇ ˇˇˇˇd
  4310. d,Times
  4311. .+H3 Guide to the File System Manager,     Helvetica
  4312. °dONLNdUHdˆ*-ABOUT THIS APPENDIX NFN gFg
  4313. °dONLNd~Hä *'QThis appendix documents three Disk Initialization Package functions not found in °dONLNde~ äÁ(á Inside°dONLNdläHññ(ìHMacintosh: Files°dONLNd|äññö)N.
  4314. °dONLNd~ªH ^(ΔHAPPLICATION PROGRAM INTERFACE ¥F¥ ÕFÕ
  4315. °dONLNdú‰HÙ*']The existing application program interface to the Disk Initialization Package as described in°dONLNd˙H¸∂* Inside Macintosh: Files°dONLNd∂¸Á)nB will continue to be supported by the enhanced Disk Initialization°dONLNdT¸H'(H0Package.  Applications which wish to initialize °dONLNdѸ'<)flonly°dONLNdà¸<˜)'  Macintosh disks will continue to work°dONLNd∞HÓ(HYand will require no changes. However, if an application wants to initialize non-Macintosh°dONLNd
  4316. H Â* Sdisks, it must use the new extended DIXFormat and DIXZero calls as described below.°dONLNd^,H8˝*\Extended programmatic interfaces to media formatting and volume initialization functions are°dONLNdª8HD˜* ]required such that applications may specify additional information for the overall formatting°dONLNdDHPÚ* [operation. This information corresponds to the new items in the user interface described in°dONLNduPH\Î* Ythe previous section: file system type and disk size. The extended programmatic interface°dONLNdœ\Hhı* Xadds three new functions to the Disk Initialization Package called DIXFormat and DIXZero°dONLNd(hHtL* 3(for extended DIFormat and DIZero), and DIReformat.°dONLNd\ÄTåê+ 
  4317. Warning:  °dONLNdfÄêå‡)<HApplications should insure that the extended Disk Initialization Package°dONLNdØåTò‚(ïTPfunctions are present before making the DIXFormat, DIXZero, or DIReformat calls.°dONLNdòT§”* RThis is done by calling Gestalt with the gestaltFSAttr selector. The extended Disk°dONLNdS§T∞›* YInitialization Package functions is available if the Gestalt function returns a result of°dONLNd≠∞Tº‡* UnoErr and the gestaltHasExtendedDiskInitbit (bit 6) is set in the response parameter.°dONLNdºT»–* RDue to the nature of older versions of the Disk Initialization Package, making the°dONLNdV»T‘´* Gextended requests when they are not available may cause a system crash.°dONLNdûÊHÚÎ(ÔH\Listing 5-1 illustrates how you use Gestalt to determine if the extended Disk Initialization°dONLNd˚ÚH˛fl*  Package functions are available.°dONLNd
  4318. uπ+- Listing 5-1.°dONLNd(
  4319. π’)D<  Testing for extended Disk Initialization Package functions,
  4320. Courier
  4321. °dONLNdeH+r((HBoolean°dONLNdm~+&)6HasExtendedDIFunctions(void)°dONLNdä+H7N(4H{°dONLNdç7ZCÆ+ long response;°dONLNdüOZ[t*/if (Gestalt(gestaltFSAttr, &response) == noErr)°dONLNd—[lg‡+ >return ((response & (1L << gestaltHasExtendedDiskInit)) != 0);°dONLNdgZsr(pZelse°dONLNdslΔ+ return (false);°dONLNd(HãN(àH}
  4322. *jA-) 2)$Application Program Interfaceˇòdˇ ˇˇˇˇd
  4323. d,Times
  4324. .(3Z(The Extended Disk Initialization Package,     Helvetica
  4325. °dONLNdU`dÆ(``    DIXFormat d^d§
  4326. °dONLNd
  4327. q`}*VThe DIXFormat function performs the same function as the DIFormat function except that°dONLNda}`â„* drive size may be specified.,
  4328. Courier
  4329. °dONLNd~ñ`¢û*5pascal OSErr DIXFormat(short drvNum, Boolean fmtFlag,°dONLNdª¢˜Æ +ó .unsigned long fmtArg, unsigned long *actSize);
  4330. °dONLNdÍπ`≈à(¬`drvNum°dONLNdÒπÃ≈∏)l2Contains the driver number of the drive to format.°dONLNd$Õ`ŸÖ(÷`fmtFlag°dONLNd,Õß
  4331. )lBContains a boolean value which specifies the meaning of the fmtArg°dONLNdoŸÃ¢*     paramter.°dONLNdyÌ`˘Ç(ˆ`fmtArg°dONLNdÄÌÃ˘)lIIf fmtFlag is true, fmtArg specifies the actual value to be passed to the°dONLNd ˘Ã˘* @disk driver in the csParam field of the parameter block when the°dONLNd Ã* G“format” _Control call is made to initialize the disk media. (The value°dONLNdSÃ* His an index into the size list. For an explanation of appropriate values°dONLNdúÃ)
  4332. * Afor this parameter, see the Technical Note “What Your Sony Drives°dONLNdfi)Ã5*
  4333. For You”.)°dONLNdÈ5ÃA    * FIf fmtFlag is false, fmtArg specifies the desired size of the media in°dONLNd0AÃM * Dnumber of 512-byte blocks. The disk driver is called to get possible°dONLNduMÃY* Esizes and the values in an to attempt to match the requested size. If°dONLNdªYÃeì* -more than one size list entry exists for the °dONLNdËYìe¿)«    same size°dONLNdÒY¿e)-, the first entry in°dONLNdeÃq(nÃFthe list returned by the driver that best matches the fmtArg parameter°dONLNdMqÃ}Ì* ?will be used. For more information about the size list, see the°dONLNdç}Ãâ
  4334. * @Technical Note “What Your Sony Drives For You”. If the specified°dONLNdŒâÃï* Msize is larger than the largest size in the size list returned by the driver,°dONLNdïð* Kthen the largest size will be used and that size is returned in actSize. If°dONLNdh°Ã≠ı* Ethe specified size is smaller than the smallest size in the size list°dONLNdÆ≠Ãπ* Ireturned by the driver, then the smallest size will be used and that size°dONLNd¯πÃ≈* Dis returned in actSize. For a specified value that is in between and°dONLNd=≈ע* Awithout an exact match, the value closest to and smaller than the°dONLNd—Û6* requested size is used.°dONLNdóÂ`ÒÅ(Ó`actSize°dONLNdüÂÃÒ)l<Contains a pointer to an unsigned long. Upon completion of a°dONLNd‹ÒÃ˝* Dsuccessful formatting operation, DIXFormat places the actual size of°dONLNd!˝Ã    ˆ* ?the formatted media in number of 512-byte blocks into the field°dONLNda    ÃU* referred to by this parameter.°dONLNdÄ'`3(0`\The formatting of file systems requiring specific media formats should be done by specifying°dONLNd›3`? * [those media formats explicitly and not by counting on disk size alone. Foreign file systems°dONLNd9?`K* _with specific media requirements should use the driver specific information in the size list or°dONLNdôK`W* [should make appropriate driver _Status calls for additional information when called upon to°dONLNdıW`cÀ* “evaluate the size list”.°dONLNd    o`{ı*NAs in DIFormat, DIXFormat does not unmount the volume. You have to unmount the°dONLNd    ^{`á* Xvolume before issuing this call if necessary. If the volume has not been unmounted, then°dONLNd    ∑á`ì(* (DIXFormat will return volOnLinErr error.+˛bApplication Program Interface)´A-) 3ˇ~dˇ ˇˇˇˇd
  4335. d,Times
  4336. .+H3 Guide to the File System Manager°dONLNdiTuê+ ? Result codes°dONLNd
  4337. ugÅÇ+ noErr°dONLNduˆÅ¸)è0°dONLNduÅD)%No error°dONLNdÅgç¶(äg volOnLinErr °dONLNd+ÅÏç¸)Ö-55°dONLNd/Åçk)/Volume is online°dONLNd@çgôô(ñg
  4338. lastDskErr°dONLNdKçÏô¸)Ö-64°dONLNdOçô‹)/*Last of the range of low-level disk errors°dONLNdzôg•s(¢g...°dONLNd~•g±ú* firstDskErr°dONLNdä•ϱ¸)Ö-84°dONLNd镱fi)/+First of the range of low-level disk errors,     Helvetica
  4339. °dONLNd∫”H‚Ñ(fiHDIXZero ‚F‚å
  4340. °dONLNd¬ÔH˚˚*[The DIXZero function performs the same function as the DIZero function except that the file°dONLNd˚H* Zsystem, format result, volume type, volume size and extended formatting information may be°dONLNdyHv*
  4341. specified.,
  4342. Courier
  4343. °dONLNdÑ H,¯*Hpascal OSErr DIXZero(short drvNum, ConstStr255Param volName, short fsid,°dONLNd‘,fl8’+ó )short mediaStatus, short volTypeSelector,°dONLNd8flDÛ* .unsigned long volSize, void *extendedInfoPtr);
  4344. °dONLNd4OH[p(XHdrvNum°dONLNd;O¥[®)l6Contains the driver number of the drive to initialize.°dONLNdrcHos(lHvolName°dONLNdzc¥oÙ)lEContains a pointer to a Pascal string which specifies the name of the°dONLNd¿o¥{€* volume.°dONLNd»ÉHèZ(åHfsid°dONLNdÕÉ¥è˜)lDContains the ID of the file system whose format should be written to°dONLNdè¥õÏ* Bthe disk. The file system ID can be obtained using the File System°dONLNdUõ¥ßA* Manager GetFSInfo function.°dONLNdqØHªÅ(∏H mediaStatus°dONLNd}Ø¥ª¸)lJContains a flag to indicate the status of the disk media. Its value is the°dONLNd»ª¥«˛* Fresult code returned from the DIVerify function. If mediaStatus is non°dONLNdª˛«(ƒ˛-°dONLNd«¥”˚(–¥Gzero, then the disk contains bad sectors and needs to be spared. If the°dONLNdW”¥flÕ* <file system specified doesn’t support bad block sparing (the°dONLNdîfl¥Î* @diCIDoesSparingBit in the compInterfMask field of the DICIRec is°dONLNd’Î¥˜˘* Jclear), the Disk Initialization Package will just return this value as the°dONLNd ˜¥˝* Hfunction result. If the file system supports bad block sparing, then the°dONLNdi¥˘* JDisk Initialization Package will gather the defect list and pass it to the°dONLNd¥¥Î* file system.°dONLNd¡#H/ï(,HvolTypeSelector°dONLNd—#¥/ı)lEContains the volume type selector if the foreign file system supports°dONLNd/¥;* @more than one volume type (diCIHasMultiVolTypesBit is set in the°dONLNdX;¥G¨* 3compInterfMask field of the file system’s DICIRec).°dONLNdåOH[k(XHvolSize°dONLNdîO¥[¯)lFContains the size in 512-byte blocks of the file system that should be°dONLNd€[¥g˜* Fwritten to the drive specified by drvNum. This is the size returned in°dONLNd"g¥s˘* Ethe actSize field by DIXFormat - the amount of space usable by a file°dONLNdhs¥€* Bsystem on the specified drive as it is currently formatted. If the°dONLNd´¥ã◊* ?specified size doesn't match with the current disk format size,°dONLNdÎã¥óë* +DIXZero will return diCIVolSizeMismatchErr.°dONLNdüH´t(®HfsParams°dONLNd ü¥´Ï)lCContains a pointer to the foreign file system’s extended formatting°dONLNdd´¥∑ø* 7information (if diCIHasExtFormatParamsBit is set in the°dONLNdú∑¥√ç* -compInterfMask field of the DICIRec), or nil.(ÚHA-) 4)$Application Program Interfaceˇ
  4345. ~dˇ ˇˇˇˇd
  4346. d,Times
  4347. .(3Z(The Extended Disk Initialization Package°dONLNdU`aı(^`QAs in DIZero, DIXZero does not unmount the volume but it will, however, mount the°dONLNdRa`m
  4348. * Yvolume if the operation is successful. You have to unmount the volume before issuing this°dONLNd¨m`yÒ* Tcall if necessary. If the volume is mounted when DIZero or DIXZero is called, then a°dONLNdy`Ö* #volOnLinErr error will be returned.°dONLNd%ôl•®+   Result codes°dONLNd2•±ö+ noErr°dONLNd8•±)è0°dONLNd:•3±\)%No error°dONLNdC±Ωó(∫ioErr°dONLNdI±Ω)Ö-36°dONLNdM±3Ω\)/    I/O error°dONLNdWΩ…´(ΔparamErr°dONLNd`Ω…)Ö-50°dONLNddΩ3…¿)/Drive number specified is bad°dONLNdÇ…’æ(“ volOnLinErr °dONLNdè…’)Ö-55°dONLNdì…3’®)/Volume is already online°dONLNd¨’·´(finsDrvErr°dONLNdµ’·)Ö-56°dONLNdπ’3·v)/
  4349. No such drive°dONLNd«·̱(Í
  4350. lastDskErr°dONLNd“·Ì)Ö-64°dONLNd÷·3ÌÙ)/*Last of the range of low-level disk errors°dONLNdÌ˘ã(ˆ...°dONLNd˘¥* firstDskErr°dONLNd˘)Ö-84°dONLNd˘3ˆ)/+First of the range of low-level disk errors°dONLNdA∏(
  4351. memFullErr°dONLNdL˛)-108°dONLNdQ3ï)5Not enough memory,     Helvetica
  4352. °dONLNdc3`B≥(>`
  4353. DIReformat B^B§
  4354. °dONLNdnO`[H*.The DIReformat function reformats disk volume.,
  4355. Courier
  4356. °dONLNdùh`tÜ*1pascal OSErr DIReformat(short drvNum, short fsid,°dONLNd÷t˜Äç+ó ConstStr255Param volName,°dONLNdˆĘåì* ConstStr255Param msgText);
  4357. °dONLNdó`£à(†`drvNum°dONLNdóã∏)l2Contains the driver number of the drive to format.°dONLNdK´`∑r(¥`fsid°dONLNdP´Ã∑)lDContains the ID of the file system whose format should be written to°dONLNdï∑Ã√* Bthe disk. The file system ID can be obtained using the File System°dONLNdÿ√ÜY* Manager GetFSInfo function.°dONLNdÙ◊`„ã(‡`volName°dONLNd¸◊Ä )lEContains a pointer to a Pascal string which specifies the name of the°dONLNdB„ÃÔÛ* volume.°dONLNdJ˜`â(`msgText°dONLNdR˜Ã )lEContains a pointer to a Pascal string which specifies the explanatory°dONLNdòÖ* ;text to be displayed in the disk initialization dialog box.°dONLNd‘!`-(*`[In the past, reformatting disk was accomplished by calling the DIBadMount function with the°dONLNd0-`9* \high word of the evtMessage parameter set to noErr and the explanatory text was set with the°dONLNdç9`E    * ZParamText function. The DIReformat function provides the caller the ability to provide the°dONLNdËE`Q* \explanatory text, the default file system ID, and the default name for the reformatted disk.°dONLNdE]liã+ Note:°dONLNdJ]ãik).  The volume in the drive specified by drvNum °dONLNdx]kiê)‡must be°dONLNd]êi˚)% mounted when calling°dONLNdïilu´(rl DIReformat .+ÚÄApplication Program Interface)´A-) 5ˇJdˇ ˇˇˇˇd
  4358. d,Times
  4359. .+H3 Guide to the File System Manager°dONLNdiTuê+ ? Result codes°dONLNd
  4360. ugÅÇ+ noErr°dONLNduˆÅ¸)è0°dONLNduÅD)%No error°dONLNdÅgçÿ(ägdiCINoMessageTextErr°dONLNd3Åç¸)â28°dONLNd6Åçô)+msgText was not provided°dONLNdOçgôì(ñgparamErr°dONLNdXçÏô¸)Ö-50°dONLNd\çô®)/Drive number specified is bad°dONLNdzôg•ì(¢gnsDrvErr°dONLNdÉôÏ•¸)Ö-56°dONLNdáô•^)/
  4361. No such drive°dONLNdï•g±ô(Æg
  4362. lastDskErr°dONLNd†•ϱ¸)Ö-64°dONLNd§•±‹)/*Last of the range of low-level disk errors°dONLNdœ±gΩs(∫g...°dONLNd”Ωg…ú* firstDskErr°dONLNdflΩÏ…¸)Ö-84°dONLNd„Ω…fi)/+First of the range of low-level disk errors°dONLNd…g’†(“g
  4363. memFullErr°dONLNd…Ê’¸)-108°dONLNd…’})5Not enough memory(ÚHA-) 6)$Application Program Interfaceˇdˇ ˇˇˇˇd
  4364. d,     Helvetica
  4365. .°dONLNdV`h€+`d APPENDIX B:°dONLNd Vh¸)êADDITIONAL FILE MANAGER Q^Q°dONLNd$l~U*ROUTINES ~^~,Times
  4366. (ÚB-) 1ˇ dˇ ˇˇˇˇd
  4367. d,Times
  4368. .+H3 Guide to the File System Manager,     Helvetica
  4369. °dONLNdUHdˆ*-ABOUT THIS APPENDIX NFN gFg
  4370. °dONLNd~HäÜ*'BThis appendix documents two File Manager routines that are not in °dONLNdW~ÜäÙ(áÜInside Macintosh: Files°dONLNdoäHñ0(ìH0but must be documented for foreign file systems.
  4371. °dONLNd†ªH ^*3APPLICATION PROGRAM INTERFACE ¥F¥ ÕFÕ
  4372. °dONLNdæ‰H˚*'RThe following two functions, PBHUnmountVol and PBGetXCatInfo are not documented in°dONLNdH¸∂* Inside Macintosh: Files°dONLNd(∂¸Ò)n>. Foreign file systems must respond correctly to PBHUnmountVol°dONLNdg¸H˘(HSand may want to support PBGetXCatInfo. Applications may use PBGetXCatInfo, but must°dONLNdªHb* never°dONLNd¿b“) call PBHUnmountVol.,
  4373.  
  4374. Zapf Dingbats
  4375. °dONLNd’ T,_(*Ts°dONLNd◊!f-ö)Warning:°dONLNdfl!ö-Ë)4B PBHUnmountVol is reserved for use only by the Macintosh operating°dONLNd"-f9È(6fJsystem. The operating system uses PBHUnmountVol to unconditionally unmount°dONLNdm9fE«* Ivolumes before system shutdown or restart. Applications should never call°dONLNd∑EfQÀ* CPBHUnmountVol because PBHUnmountVol can close files in use by other°dONLNd˚Qf]Å* <applications which can cause data loss or media corruption. 
  4376.     °dONLNd7SÅ\â(ZÅs
  4377. °dONLNd9{Häø(ÜH
  4378. PBHUnmountVol äFäå
  4379. °dONLNdGóH£â*<The PBHUnmountVol function unconditionally unmounts a volume,
  4380. Courier
  4381. °dONLNdÑ∞Hºt*2pascal OSErr PBHUnmountVol(ParmBlkPtr paramBlock);
  4382. °dONLNd∑«H”Å*
  4383. paramBlock°dONLNd¬«¥”q)l&Contains a pointer to a ParamBlockRec.°dONLNdÈÌT˘≠(ˆT
  4384. ParamBlockRec,    Symbol°dONLNd˜˘T
  4385. `*¨°dONLNd˘˝g    é)ioResult°dONLNd˝Δ    ‰)_OSErr°dONLNd˝    ´)Q The result code of the function.°dONLNd)
  4386. T`(TưdONLNd+gö)    ioNamePtr°dONLNd5ΔÒ)_    StringPtr°dONLNd?ã)QA pointer to a pathname.°dONLNdXT,`((TưdONLNdZg+°)    ioVRefNum°dONLNddΔ+fi)_short°dONLNdj+˛)Q.A volume reference number, a working directory°dONLNdù,8Î*
  4387. ,reference number, drive number, or 0 for the°dONLNdŒ8Da* default volume.°dONLNdfiTH`(]HXThe PBHUnmountVol function unconditionally unmounts the specified volume. All user files°dONLNd7`Hlá* Bon the volume will be closed by the file system owning the volume.°dONLNdzxHÑy*9The PBHUnmountVol function always executes synchronously.
  4388. °dONLNd¥êTú_+ s°dONLNd∂ëfùö)Warning:°dONLNdæëöùË)4B PBHUnmountVol is reserved for use only by the Macintosh operating°dONLNdùf©È(¶fJsystem. The operating system uses PBHUnmountVol to unconditionally unmount°dONLNdL©fµ«* Ivolumes before system shutdown or restart. Applications should never call°dONLNdñµf¡À* CPBHUnmountVol because PBHUnmountVol can close files in use by other°dONLNd⁄¡fÕÅ* <applications which can cause data loss or media corruption. 
  4389.     °dONLNd√ÅÃâ( Ås
  4390. (ÚHB-) 2)$Application Program InterfaceˇÑdˇ ˇˇˇˇd
  4391. d,Times
  4392. .(3w!Additional File Manager Functions°dONLNdU`a9(^`ASSEMBLY-LANGUAGE INFORMATION°dONLNdm`y:*(The trap word for PBHUnmountVol is A20E.°dONLNdGçlô®+   Result codes°dONLNdTô•ö+ noErr°dONLNdZô•)è0°dONLNd\ô3•\)%No error°dONLNde•±ü(ÆnsvErr°dONLNdl•±)É–35°dONLNdp•3±÷)1No such volume reference number°dONLNdê±Ωó(∫ioErr°dONLNdñ±Ω)É–36°dONLNdö±3Ω\)1    I/O error°dONLNd§Ω…±(ΔbdNamErr°dONLNd≠Ω…)É–37°dONLNd±Ω3…à)1Bad volume name°dONLNd¡…’´(“paramErr°dONLNd …’)É–50°dONLNdŒ…3’ã)1No default volume°dONLNd‡’·´(finsDrvErr°dONLNdÈ’·)É–56°dONLNdÌ’3·v)1
  4393. No such drive°dONLNd˚·Ì™(ÍextFSErr°dONLNd·Ì)É–58°dONLNd·3Ì÷)1!No file system claimed the volume,     Helvetica
  4394. °dONLNd*`Õ(`
  4395. PBGetXCatInfo ^§
  4396. °dONLNd8+`7*UYou can use the PBGetXCatInfo function to get the short name (MS-DOS format name) and°dONLNdé7`C6* -ProDOS information for files and directories.,
  4397. Courier
  4398. °dONLNdºP`\™*7pascal OSErr PBGetXCatInfoSync(XCInfoPBPtr paramBlock);°dONLNdÙ\`h∞* 8pascal OSErr PBGetXCatInfoAsync(XCInfoPBPtr paramBlock);
  4399. °dONLNd-s`ô*
  4400. paramBlock°dONLNd8sÃÉ)l$Contains a pointer to a XCInfoPBRec.°dONLNd]ôl•Ω(¢l XCInfoPBRec,    Symbol°dONLNdi•l∂x*ưdONLNdk©µø) ioCompletion°dONLNdx©fiµ    )_    StringPtr°dONLNdÇ©/µ)Q*Contains a pointer to PBGetXCatInfoAsync’s°dONLNd±∂/¬ã*
  4401. completion routine.°dONLNd≈¬l”x(œl¨°dONLNd«Δ“¶)ioResult°dONLNd–Δfi“¸)_OSErr°dONLNd÷Δ/“    )Q.PBGetXCatInfo places its result code into this°dONLNd    ”/flH*
  4402. field.°dONLNdfllx(ÏlưdONLNd„Ô≤)    ioNamePtr°dONLNd„fiÔ    )_    StringPtr°dONLNd&„/Ô)Q2Contains a pointer to the object name, or nil when°dONLNd]/¸*
  4403. 0ioDirID specifies a directory that’s the object.°dONLNdé¸l
  4404. x(    lưdONLNdê π)    ioVRefNum°dONLNdöfi ˆ)_short°dONLNd†/ …)Q Contains a volume specification.°dONLNd¡
  4405. lx(lưdONLNd√Ã)ioShortNamePtr°dONLNd“fi¸)_OSErr°dONLNdÿ/¯)Q,Contains a pointer to a Pascal string buffer°dONLNd    /**
  4406. ((minimum 13 bytes). PBGetXCatInfo places°dONLNd6*/6    * 1the short name into the field referred to by this°dONLNdl6/BÙ* (parameter. ioShortNamePtr cannot be nil.°dONLNdïBlSx(Ol¨°dONLNdóFRØ)ioPDType°dONLNd†FfiRˆ)_short°dONLNd¶F/R)Q.PBGetXCatInfo places the ProDOS file type into°dONLNdŸS/_\*
  4407. this field.°dONLNdÂ_lpx(ll¨°dONLNdÁco√) ioPDAuxType°dONLNdÛcfioÛ)_long°dONLNd¯c/o)Q)PBGetXCatInfo places the ProDOS auxiliary°dONLNd&p/|à*
  4408. type into this field.°dONLNd<|lçx(âlưdONLNd>Äå£)ioDirID°dONLNdFÄfiåÛ)_long°dONLNdKÄ/å°)QContains a directory ID.°dONLNddù`© (¶`SPBGetXCatInfo returns the short name (MS-DOS format name) and ProDOS file/auxiliary°dONLNd∏©`µ* ^type information for files and directories on volumes that support this function. Volumes that°dONLNdµ`¡* Xsupport PBGetXCatInfo will have the bHasShortName bit set in the vMAttrib field returned°dONLNdp¡`ÕÀ* by PBHGetVolParms.+˛(Application Program Interface)´B-) 3ˇ¥dˇ ˇˇˇˇd
  4409. d,Times
  4410. .+H3 Guide to the File System Manager°dONLNdUHaˆ*+]The following data structure and inline glue code is needed for applications that wish to use°dONLNd^aHmô* PBGetXCatInfo.,
  4411. Courier
  4412. °dONLNdmÇTéÃ+ !struct XCInfoPBRec {°dONLNdÇérö¢+ QElemPtr°dONLNdãéÿö¸)fqLink;°dONLNdíör¶ê(£rshort°dONLNdòöÿ¶¸)fqType;°dONLNdü¶r≤ê(Ørshort°dONLNd•¶ÿ≤)fioTrap;°dONLNd≠≤ræÑ(ªrPtr°dONLNd±≤ÿæ)f
  4413. ioCmdAddr;°dONLNdºær ú(«rProcPtr°dONLNdƒæÿ &)f
  4414. ioCompletion;°dONLNd“æD Ï)l/* A pointer to a completion°dONLNdÙ V÷í+
  4415. routine */°dONLNdˇ÷r‚ê(flrOSErr°dONLNd÷ÿ‚&)f
  4416. ioResult;    °dONLNd÷D‚⁄)l/* The result code of the°dONLNd2‚VÓò+ function */°dONLNd>Ór˙®(˜r    StringPtr°dONLNdHÓÿ˙)f
  4417. ioNamePtr;°dONLNdSÓD˙Ï)l/* Pointer to object name or°dONLNdu˙Vz+ nil */°dONLNd|rê(rshort°dONLNdÇÿ)f
  4418. ioVRefNum;°dONLNdçDÏ)l/* A volume specification */°dONLNd™rä(rlong°dONLNdØÿ)ffiller1;°dONLNd∏r*®('r    StringPtr°dONLNd¬ÿ*2)fioShortNamePtr;°dONLNd“D*¯)l/* A pointer to the short name°dONLNdˆ*V6˛+ string buffer - required! */°dONLNd6rBê(?rshort°dONLNd6ÿB)ffiller2;°dONLNd"BrNê(Krshort°dONLNd(BÿN)f    ioPDType;°dONLNd2BDN‡)l/* The ProDOS file type */°dONLNdMNrZä(Wrlong°dONLNdRNÿZ )f ioPDAuxType;°dONLNd_NDZ⁄)l/* The ProDOS aux type */°dONLNdyZrfä(crlong°dONLNd~Zÿf)f
  4419. filler[2];°dONLNdâfrrä(orlong°dONLNdéfÿr)fioDirID;°dONLNdófDrº)l/* A directory ID */°dONLNd¨rr~~({r};°dONLNdØ~rä\* 'typedef struct XCInfoPBRec XCInfoPBRec;°dONLNd◊ärñ8* !typedef XCInfoPBRec *XCInfoPBPtr;°dONLNd˘ûH™\(ßH.#pragma parameter __D0 PBGetXCatInfoSync(__A0)°dONLNd(™H∂å* 6pascal OSErr PBGetXCatInfoSync(XCInfoPBPtr paramBlock)°dONLNdd∂¢¬+Z = {0x703A,0xA260};°dONLNdw¬HŒb(ÀH/#pragma parameter __D0 PBGetXCatInfoAsync(__A0)°dONLNdߌH⁄í* 7pascal OSErr PBGetXCatInfoAsync(XCInfoPBPtr paramBlock)°dONLNd‰⁄¢Ê+Z = {0x703A,0xA660};
  4420. °dONLNd˜˘Hπ(HLFor more information about short names and ProDOS file/auxiliary types, see °dONLNdC˘π÷(πInside°dONLNdJHƒ(HAppleTalk, second edition°dONLNdcƒ¶)|/, Chapter 13 AppleTalk Filing Protocol, and the°dONLNdí¶)‚ Apple II File Type°dONLNd¶Hd(HNotes°dONLNd´dh).°dONLNd≠)H5!(2HASSEMBLY-LANGUAGE INFORMATION°dONLNdÀAHMÆ*FThe PBGetXCatInfo function uses routine selector $003A of HFSDispatch.°dONLNdaTmê+   Result codes°dONLNdmgyÇ+ noErr°dONLNd%mˆy¸)è0°dONLNd'myD)%No error°dONLNd0ygÖá(ÇgnsvErr°dONLNd7yÏÖ¸)Ö-35°dONLNd;yÖi)/No such volume°dONLNdJÖgëÑ(égfnfErr°dONLNdQÖÏë¸)Ö-43°dONLNdUÖë^)/File not found°dONLNddëgùì(ögparamErr°dONLNdmëÏù¸)Ö-50°dONLNdqëùæ)/ Function not supported by volume°dONLNdíùg©ì(¶gdirNFErr°dONLNdõùÊ©¸)-120°dONLNd†ù©x)5Directory not found(ÚHB-) 4)$Application Program Interfaceˇdˇ ˇˇˇˇd
  4421. d,     Helvetica
  4422. .°dONLNdV`h‹+`d APPENDIX C:°dONLNd Vh)êFILE SYSTEM ROUTINE TABLE Q^Q h^h,Times
  4423. (ÚC-) 1ˇ$˛dˇ ˇˇˇˇd
  4424. d,Times
  4425. .+H3 Guide to the File System Manager,     Helvetica
  4426. °dONLNdUHdˆ*-ABOUT THIS APPENDIX NFN gFg
  4427. °dONLNd~Häÿ*'XThis appendix lists all File Manager routine and the select codes that your foreign file°dONLNdmäHñ    * &system’s HFSCIProc can be called with.,
  4428. Courier
  4429.     °dONLNdî±Hºr*&Routine°dONLNdúΩH»`* Name°dONLNd°±æº‚(πæSelect°dONLNd®Ωæ»÷* Code°dONLNd≠±Íº(πÍRequired°dONLNd∂±#ºG)9Volume°dONLNdΩΩ#»_*
  4430. Attributes°dONLNd»±rºê(πrNotes"ÆC#"ÆDt"Æπ"Æ∫*"ÆÂ"ÆÊ7"Æ"ÆM"Æm ÆnƸ"Æ˝#"ØC"Øπ"ØÂ"Ø"Øm"Ø˝°dONLNdœ H’¥(“HFile Manager Traps"«C"«Dt"«π"«∫*"«Â"«Ê7"«"«M"«m «n«¸"«˝"»C "»π "»Â "» "»m "»˝ °dONLNdÁ◊H‚\*
  4431. Open°dONLNdÏ◊æ‚◊)v$A000°dONLNdÚ◊Í‚Ô),•"‘C"‘Dt"‘π"‘∫*"‘Â"‘Ê7"‘"‘M"‘m ‘n‘¸"‘˝"’C "’π "’ "’ "’m "’˝ °dONLNd˜‰HÔa(ÏHClose°dONLNd˝‰æÔ◊)v$A001°dONLNd‰ÍÔÔ),•"·C"·Dt"·π"·∫*"·Â"·Ê7"·"·M"·m ·n·¸"·˝"‚C "‚π "‚ "‚ "‚m "‚˝ °dONLNdÒH¸\(˘HRead°dONLNd
  4432. Òæ¸◊)v$A002°dONLNdÒ͸Ô),•"ÓC"ÓDt"Óπ"Ó∫*"ÓÂ"ÓÊ7"Ó"ÓM"Óm ÓnÓ¸"Ó˝"ÔC "Ôπ "Ô "Ô "Ôm "Ô˝ °dONLNd˛H    a(HWrite°dONLNd˛æ    ◊)v$A003°dONLNd$˛Í    Ô),•"˚C"˚Dt"˚π"˚∫*"˚Â"˚Ê7"˚"˚M"˚m ˚n˚¸"˚˝"¸C "¸π "¸Â "¸ "¸m "¸˝ °dONLNd) Hz(H
  4433. GetVolInfo°dONLNd7 æ◊)v$A007°dONLNd= ÍÔ),•"C"Dt"π"∫*"Â"Ê7""M"m n¸"˝"    C "    π "    Â "     "    m "    ˝ °dONLNdBH#f( HCreate°dONLNdLæ#◊)v$A008°dONLNdRÍ#Ô),•"C"Dt"π"∫*"Â"Ê7""M"m n¸"˝"C "π " " "m "˝ °dONLNdW%H0f(-HDelete°dONLNda%æ0◊)v$A009°dONLNdg%Í0Ô),•""C""Dt""π""∫*""Â""Ê7""""M""m "n"¸""˝"#C "#π "# "# "#m "#˝ °dONLNdl2H=f(:HOpenRF°dONLNdv2æ=◊)v$A00A°dONLNd|2Í=Ô),•"/C"/Dt"/π"/∫*"/Â"/Ê7"/"/M"/m /n/¸"/˝"0C "0π "0 "0 "0m "0˝ °dONLNdÅ?HJf(GHRename°dONLNdã?æJ◊)v$A00B°dONLNdë?ÍJÔ),•"<C"<Dt"<π"<∫*"<Â"<Ê7"<"<M"<m <n<¸"<˝"=C "=π "= "= "=m "=˝ °dONLNdñLHW(TH GetFileInfo°dONLNd§LæW◊)v$A00C°dONLNd™LÍWÔ),•"IC"IDt"Iπ"I∫*"IÂ"IÊ7"I"IM"Im InI¸"I˝"JC "Jπ "J "J "Jm "J˝ °dONLNdØYHd(aH SetFileInfo°dONLNdΩYæd◊)v$A00D°dONLNd√YÍdÔ),•"VC"VDt"Vπ"V∫*"VÂ"VÊ7"V"VM"Vm VnV¸"V˝"WC "Wπ "W "W "Wm "W˝ °dONLNd»fHqz(nH
  4434. UnmountVol°dONLNd÷fæq◊)v$A00E°dONLNd‹fÍqÔ),•"cC"cDt"cπ"c∫*"cÂ"cÊ7"c"cM"cm cnc¸"c˝"dC "dπ "d "d "dm "d˝ °dONLNd·sH~p({HMountVol°dONLNdÎsæ~◊)v$A00F°dONLNdÒsÍ~Ô),•"pC"pDt"pπ"p∫*"pÂ"pÊ7"p"pM"pm pnp¸"p˝"qC "qπ "q "q "qm "q˝ °dONLNdˆÄHãp(àHAllocate°dONLNdÄæã◊)v$A010°dONLNdÄÍãÔ),•"}C"}Dt"}π"}∫*"}Â"}Ê7"}"}M"}m }n}¸"}˝"~C "~π "~ "~ "~m "~˝ °dONLNd çHòf(ïHGetEOF°dONLNdçæò◊)v$A011°dONLNdçÍòÔ),•"äC"äDt"äπ"ä∫*"äÂ"äÊ7"ä"äM"äm änä¸"ä˝"ãC "ãπ "ã "ã "ãm "ã˝ °dONLNd öH•f(¢HSetEOF°dONLNd*öæ•◊)v$A012°dONLNd0öÍ•Ô),•"óC"óDt"óπ"ó∫*"óÂ"óÊ7"ó"óM"óm ónó¸"ó˝"òC "òπ "ò "ò "òm "ò˝ °dONLNd5ßH≤p(ØHFlushVol°dONLNd?ßæ≤◊)v$A013°dONLNdEßÍ≤Ô),•"§C"§Dt"§π"§∫*"§Â"§Ê7"§"§M"§m §n§¸"§˝"•C "•π "• "• "•m "•˝ °dONLNdJ¥Høf(ºHGetVol°dONLNdT¥æø◊)v$A014"±C"±Dt"±π"±∫*"±Â"±Ê7"±"±M"±m ±n±¸"±˝"≤C "≤π "≤ "≤ "≤m "≤˝ °dONLNd^¡HÃf(…HSetVol°dONLNdh¡æÃ◊)v$A015"æC"æDt"æπ"æ∫*"æÂ"æÊ7"æ"æM"æm ænæ¸"æ˝"øC "øπ "øÂ "ø "øm "ø˝ °dONLNdrŒHŸz(÷H
  4435. FInitQueue°dONLNdÄŒæŸ◊)v$A016°dONLNdàŒrŸÂ)¥Never passed to foreign°dONLNd†⁄rÂ≥*
  4436. file systems."ÀC"ÀDt"Àπ"À∫*"ÀÂ"ÀÊ7"À"ÀM"Àm ÀnÀ¸"À˝"ÃC"Ãπ"ÃÂ"Ã"Ãm"Ã˝°dONLNdØÁHÚa(ÔHEject°dONLNdµÁæÚ◊)v$A017°dONLNdªÁÍÚÔ),•"‰C"‰Dt"‰π"‰∫*"‰Â"‰Ê7"‰"‰M"‰m ‰n‰¸"‰˝"ÂC "Âπ " " "Âm "½ °dONLNd¿ÙHˇk(¸HGetFPos°dONLNd Ùæˇ◊)v$A018°dONLNd–Ù͡Ô),•"ÒC"ÒDt"Òπ"Ò∫*"ÒÂ"ÒÊ7"Ò"ÒM"Òm ÒnÒ¸"Ò˝"ÚC "Úπ "Ú "Ú "Úm "Ú˝ °dONLNd’H k(    HOffline°dONLNd›æ ◊)v$A035°dONLNd„Í Ô),•"˛C"˛Dt"˛π"˛∫*"˛Â"˛Ê7"˛"˛M"˛m ˛n˛¸"˛˝"ˇC "ˇπ "ˇÂ "ˇ "ˇm "ˇ˝ °dONLNdËHz(H
  4437. SetFilLock°dONLNdÙæ◊)v$A041°dONLNd˙ÍÔ),•" C" Dt" π" ∫*" Â" Ê7" " M" m  n ¸" ˝" C " π "  "  " m " ˝ °dONLNdˇH&z(#H
  4438. RstFilLock°dONLNd æ&◊)v$A042°dONLNdÍ&Ô),•"C"Dt"π"∫*"Â"Ê7""M"m n¸"˝"C "π "Â " "m "˝ °dONLNd(H3z(0H
  4439. SetFilType°dONLNd"(æ3◊)v$A043°dONLNd((Í3Ô),•°dONLNd+(r3Ù)àThis call is obsolete, but°dONLNdF4r?€* it does get passed to°dONLNd\@rKÔ* foreign file systems. You°dONLNdvLrWÂ* should return paramErr."%C"%Dt"%π"%∫*"%Â"%Ê7"%"%M"%m %n%¸"%˝"&C/"&π/"&Â/"&/"&m/"&˝/°dONLNdèYHdk(aHSetFPos°dONLNdóYæd◊)v$A044°dONLNdùYÍdÔ),•"VC"VDt"Vπ"V∫*"VÂ"VÊ7"V"VM"Vm VnV¸"V˝"WC "Wπ "W "W "Wm "W˝ °dONLNd¢fHqu(nH    FlushFile°dONLNd¨fæq◊)v$A045°dONLNd≤fÍqÔ),•"cC"cDt"cπ"c∫*"cÂ"cÊ7"c"cM"cm cnc¸"c˝"dC "dπ "d "d "dm "d˝ °dONLNd∑sH~~({H    HFS Calls"pC"pDt"pπ"p∫*"pÂ"pÊ7"p"pM"pm pnp¸"p˝"qC "qπ "q "q "qm "q˝ °dONLNdΔÄHãa*
  4440. HOpen°dONLNdÃÄæã◊)v$A200°dONLNd“ÄÍãÔ),•"}C"}Dt"}π"}∫*"}Â"}Ê7"}"}M"}m }n}¸"}˝"~C "~π "~ "~ "~m "~˝ °dONLNd◊çHòu(ïH    HGetVInfo°dONLNd·çæò◊)v$A207°dONLNdÁçÍòÔ),•"äC"äDt"äπ"ä∫*"äÂ"äÊ7"ä"äM"äm änä¸"ä˝"ãC "ãπ "ã "ã "ãm "ã˝ °dONLNdÏöH•k(¢HHCreate°dONLNdˆöæ•◊)v$A208°dONLNd¸öÍ•Ô),•"óC"óDt"óπ"ó∫*"óÂ"óÊ7"ó"óM"óm ónó¸"ó˝"òC "òπ "ò "ò "òm "ò˝ °dONLNdßH≤k(ØHHDelete°dONLNd ßæ≤◊)v$A209°dONLNdßÍ≤Ô),•"§C"§Dt"§π"§∫*"§Â"§Ê7"§"§M"§m §n§¸"§˝"•C "•π "• "• "•m "•˝ °dONLNd¥Høk(ºHHOpenRF°dONLNd ¥æø◊)v$A20A°dONLNd&¥ÍøÔ),•"±C"±Dt"±π"±∫*"±Â"±Ê7"±"±M"±m ±n±¸"±˝"≤C "≤π "≤ "≤ "≤m "≤˝ °dONLNd+¡HÃk(…HHRename°dONLNd5¡æÃ◊)v$A20B°dONLNd;¡ÍÃÔ),•"æC"æDt"æπ"æ∫*"æÂ"æÊ7"æ"æM"æm ænæ¸"æ˝"øC "øπ "øÂ "ø "øm "ø˝ 
  4441. (ÚHC-) 2)$File System Routine Tableˇdˇ ˇˇˇˇd
  4442. d,Times
  4443. .(3ûFile System Routine Table,
  4444. Courier
  4445.     °dONLNdX`cú(`` HGetFileInfo°dONLNdX÷cÔ)v$A20C°dONLNdXc),•"U[#"U\t"U—"U“*"U˝"U˛7"U6"U7M"UÖ UÜU"U#"V[ "V— "V˝ "V6 "VÖ "V °dONLNde`pú(m` HSetFileInfo°dONLNd'e÷pÔ)v$A20D°dONLNd-ep),•"b["b\t"b—"b“*"b˝"b˛7"b6"b7M"bÖ bÜb"b"c[ "c— "c˝ "c6 "cÖ "c °dONLNd2r`}ó(z` HUnmountVol°dONLNd>r÷}Ô)v$A20E°dONLNdDr}),•°dONLNdGrä}Û)àWarning: reserved for°dONLNd]~äâ* system use only at system°dONLNdwääïÓ* shutdown or restart!°dONLNdåñä°* HUnmount unmounts a volume,°dONLNd®¢ä≠* even if files are open on°dONLNd¬Æäπ˝* the volume. The foreign°dONLNd⁄∫ä≈* file system should flush°dONLNdÛΔä—* and close all open files°dONLNd “ä›Û* before unmounting the°dONLNd"fiäÈ≠* volume."o["o\t"o—"o“*"o˝"o˛7"o6"o7M"oÖ oÜo"o"p[w"p—w"p˝w"p6w"pÖw"pw°dONLNd+Î`ˆó(Û` AllocContig°dONLNd9Î÷ˆÔ)v$A210°dONLNd?Έ),•"Ë["Ë\t"Ë—"Ë“*"Ë˝"˲7"Ë6"Ë7M"ËÖ ËÜË"Ë"È[ "È— "È˝ "È6 "ÈÖ "È °dONLNdD¯`É(`HGetVol°dONLNdN¯÷Ô)v$A214"ı["ı\t"ı—"ı“*"ı˝"ı˛7"ı6"ı7M"ıÖ ıÜı"ı"ˆ[ "ˆ— "ˆ˝ "ˆ6 "ˆÖ "ˆ °dONLNdX`É(
  4446. `HSetVol°dONLNdb÷Ô)v$A215"["\t"—"“*"˝"˛7"6"7M"Ö Ü""[ "— "˝ "6 "Ö " °dONLNdl`ç(`    HSetFLock°dONLNdv÷Ô)v$A241°dONLNd|),•"["\t"—"“*"˝"˛7"6"7M"Ö Ü""[ "— "˝ "6 "Ö " °dONLNdÅ`*ç('`    HRstFLock°dONLNdã÷*Ô)v$A242°dONLNdë*),•"["\t"—"“*"˝"˛7"6"7M"Ö Ü""[ "— "˝ "6 "Ö " °dONLNdñ,`7Ã(4`HFS Dispatch Calls")[")\t")—")“*")˝")˛7")6")7M")Ö )Ü)")"*[ "*— "*˝ "*6 "*Ö "* °dONLNdÆ9`D~*
  4447. OpenWD°dONLNdµ9÷DÔ)v$0001°dONLNdª9D),•"6["6\t"6—"6“*"6˝"6˛7"66"67M"6Ö 6Ü6"6"7[ "7— "7˝ "76 "7Ö "7 °dONLNd¿F`QÉ(N`CloseWD°dONLNd»F÷QÔ)v$0002"C["C\t"C—"C“*"C˝"C˛7"C6"C7M"CÖ CÜC"C"D[ "D— "D˝ "D6 "DÖ "D °dONLNd“S`^É([`CatMove°dONLNd⁄S÷^Ô)v$0005°dONLNd‡S^),•"P["P\t"P—"P“*"P˝"P˛7"P6"P7M"PÖ PÜP"P"Q[ "Q— "Q˝ "Q6 "QÖ "Q °dONLNdÂ``kç(h`    DirCreate°dONLNd`÷kÔ)v$0006°dONLNdˆ`k),•"]["]\t"]—"]“*"]˝"]˛7"]6"]7M"]Ö ]Ü]"]"^[ "^— "^˝ "^6 "^Ö "^ °dONLNd˚m`xç(u`    GetWDInfo°dONLNdm÷xÔ)v$0007"j["j\t"j—"j“*"j˝"j˛7"j6"j7M"jÖ jÜj"j"k[ "k— "k˝ "k6 "kÖ "k °dONLNdz`Öí(Ç`
  4448. GetFCBInfo°dONLNdz÷ÖÔ)v$0008°dONLNd!zÖ),•"w["w\t"w—"w“*"w˝"w˛7"w6"w7M"wÖ wÜw"w"x[ "x— "x˝ "x6 "xÖ "x °dONLNd&á`íí(è`
  4449. GetCatInfo°dONLNd1á÷íÔ)v$0009°dONLNd7áí),•"Ñ["Ñ\t"Ñ—"Ñ“*"Ñ˝"Ñ˛7"Ñ6"Ñ7M"ÑÖ ÑÜÑ"Ñ"Ö[ "Ö— "Ö˝ "Ö6 "ÖÖ "Ö °dONLNd<î`üí(ú`
  4450. SetCatInfo°dONLNdGî÷üÔ)v$000A°dONLNdMîü),•"ë["ë\t"ë—"ë“*"ë˝"ë˛7"ë6"ë7M"ëÖ ëÜë"ë"í[ "í— "í˝ "í6 "íÖ "í °dONLNdR°`¨í(©`
  4451. SetVolInfo°dONLNd]°÷¨Ô)v$000B°dONLNdc°¨),•"û["û\t"û—"û“*"û˝"û˛7"û6"û7M"ûÖ ûÜû"û"ü[ "ü— "ü˝ "ü6 "üÖ "ü °dONLNdhÆ`πÉ(∂`LockRng°dONLNdpÆ÷πÔ)v$0010°dONLNdvÆπ),•"´["´\t"´—"´“*"´˝"´˛7"´6"´7M"´Ö ´Ü´"´"¨[ "¨— "¨˝ "¨6 "¨Ö "¨ °dONLNd{ª`Δç(√`    UnlockRng°dONLNdܪ÷ΔÔ)v$0011°dONLNdåªΔ),•"∏["∏\t"∏—"∏“*"∏˝"∏˛7"∏6"∏7M"∏Ö ∏Ü∏"∏"π[ "π— "π˝ "π6 "πÖ "π °dONLNdë»`”´(–`CreateFileIDRef°dONLNd°»÷”Ô)v$0014°dONLNd®»;”r)e bHasFileIDs"≈["≈\t"≈—"≈“*"≈˝"≈˛7"≈6"≈7M"≈Ö ≈Ü≈"≈"Δ[ "Δ— "Δ˝ "Δ6 "ΔÖ "Δ °dONLNd∂’`‡´(›`DeleteFileIDRef°dONLNdΔ’÷‡Ô)v$0015°dONLNdÕ’;‡r)e bHasFileIDs"“["“\t"“—"““*"“˝"“˛7"“6"“7M"“Ö “Ü“"“"”[ "”— "”˝ "”6 "”Ö "” °dONLNd€‚`Ì∞(Í`ResolveFileIDRef°dONLNdÌ‚÷ÌÔ)v$0016°dONLNdÙ‚;Ìr)e bHasFileIDs"fl["fl\t"fl—"fl“*"fl˝"fl˛7"fl6"fl7M"flÖ flÜfl"fl"‡[ "‡— "‡˝ "‡6 "‡Ö "‡ °dONLNdÔ`˙°(˜`
  4452. ExchangeFiles°dONLNdÔ÷˙Ô)v$0017°dONLNdÔ;˙r)e bHasFileIDs"Ï["Ï\t"Ï—"Ï“*"Ï˝"Ï˛7"Ï6"Ï7M"ÏÖ ÏÜÏ"Ï"Ì[ "Ì— "Ì˝ "Ì6 "ÌÖ "Ì °dONLNd&¸`ç(`    CatSearch°dONLNd1¸÷Ô)v$0018°dONLNd8¸;|)e
  4453. bHasCatSearch"˘["˘\t"˘—"˘“*"˘˝"˘˛7"˘6"˘7M"˘Ö ˘Ü˘"˘"˙[ "˙— "˙˝ "˙6 "˙Ö "˙ °dONLNdH    `~(`OpenDF°dONLNdO    ÷Ô)v$001A°dONLNdW    ä˝)¥Never passed to foreign°dONLNdoä * file systems. The foreign°dONLNdâ!ä,* file system will only see°dONLNd£-ä8’* Open and HOpen."["\t"—"“*"˝"˛7"6"7M"Ö Ü""[/"—/"˝/"6/"Ö/"/
  4454. (ÚoFile System Routine Table)öC-) 3ˇdˇ ˇˇˇˇd
  4455. d,Times
  4456. .+H3 Guide to the File System Manager,
  4457. Courier
  4458.     °dONLNdXHcz*-
  4459. MakeFSSpec°dONLNd Xæc◊)v$001B°dONLNdXrc˘)¥If your foreign file system°dONLNd/droÙ* doesn't handle MakeFSSpec,°dONLNdJpr{Ô* the Macintosh file system°dONLNdd|ráÂ* will make the FSSpec by°dONLNd|àrì÷* determining the real°dONLNdëîrüÂ* vRefNum and real parent°dONLNd©†r´Í* dirID, and then indexing°dONLNd¬¨r∑Ã* through the parent°dONLNd’∏r√Ù* directory until a matching°dONLNdƒrœ˘* name is found.  This can be°dONLNd –r€Ã* *very* slow if the°dONLNd‹rÁ‡* directory has a lot of°dONLNd6ËrÛÙ* entries or if your foreign°dONLNdQÙrˇÙ* file system implementation°dONLNdlr Ô* of GetCatInfo is slow. If°dONLNdÜ r«* you don’t support°dONLNdòr#Ã* MakeFSSpec, return°dONLNd´$r/ü*     paramErr."UC#"UDt"Uπ"U∫*"UÂ"UÊ7"U"UM"Um UnU¸"U˝# VC-C Vπ-π VÂ- V- Vm-m V˝-˝°dONLNd∂1H<¢(9HDesktop Manager°dONLNdΔ=HHf* Calls".C".Dt".π".∫*".Â".Ê7".".M".m .n.¸".˝"/C"/π"/Â"/"/m"/˝°dONLNd—JHUu*
  4460.     DTGetPath°dONLNd€JæU◊)v$0020°dONLNd‚J#Ui)ebHasDesktopMgr°dONLNdÒJrUÂ)OThe returned ioDTRefNum°dONLNd    VraÍ* must be a file reference°dONLNd"brm€* number (a FCB must be°dONLNd8nryê* used)."GC"GDt"Gπ"G∫*"GÂ"GÊ7"G"GM"Gm GnG¸"G˝"HC/"Hπ/"HÂ/"H/"Hm/"H˝/°dONLNd@{HÜ(ÉH DTCloseDown°dONLNdL{æÜ◊)v$0021°dONLNdS{#Üi)ebHasDesktopMgr"xC"xDt"xπ"x∫*"xÂ"xÊ7"x"xM"xm xnx¸"x˝"yC "yπ "y "y "ym "y˝ °dONLNddàHìu(êH    DTAddIcon°dONLNdoàæì◊)v$0022°dONLNdvà#ìi)ebHasDesktopMgr"ÖC"ÖDt"Öπ"Ö∫*"ÖÂ"ÖÊ7"Ö"ÖM"Öm ÖnÖ¸"Ö˝"ÜC "Üπ "Ü "Ü "Üm "Ü˝ °dONLNdáïH†u(ùH    DTGetIcon°dONLNdíïæ†◊)v$0023°dONLNdôï#†i)ebHasDesktopMgr"íC"íDt"íπ"í∫*"íÂ"íÊ7"í"íM"ím íní¸"í˝"ìC "ìπ "ì "ì "ìm "ì˝ °dONLNd™¢H≠â(™H
  4461. DTGetIconInfo°dONLNdπ¢æ≠◊)v$0024°dONLNd¿¢#≠i)ebHasDesktopMgr"üC"üDt"üπ"ü∫*"üÂ"üÊ7"ü"üM"üm ünü¸"ü˝"†C "†π "†Â "† "†m "†˝ °dONLNd—ØH∫u(∑H    DTAddAPPL°dONLNd‹Øæ∫◊)v$0025°dONLNd„Ø#∫i)ebHasDesktopMgr"¨C"¨Dt"¨π"¨∫*"¨Â"¨Ê7"¨"¨M"¨m ¨n¨¸"¨˝"≠C "≠π "≠ "≠ "≠m "≠˝ °dONLNdÙºH«Ñ(ƒH DTRemoveAPPL°dONLNdºæ«◊)v$0026°dONLNdº#«i)ebHasDesktopMgr"πC"πDt"ππ"π∫*"πÂ"πÊ7"π"πM"πm πnπ¸"π˝"∫C "∫π "∫ "∫ "∫m "∫˝ °dONLNd…H‘u(—H    DTGetAPPL°dONLNd$…æ‘◊)v$0027°dONLNd+…#‘i)ebHasDesktopMgr"ΔC"ΔDt"Δπ"Δ∫*"ΔÂ"ΔÊ7"Δ"ΔM"Δm ΔnΔ¸"Δ˝"«C "«π "«Â "« "«m "«˝ °dONLNd<÷H·Ñ(fiH DTSetComment°dONLNdI÷æ·◊)v$0028°dONLNdP÷#·i)ebHasDesktopMgr"”C"”Dt"”π"”∫*"”Â"”Ê7"”"”M"”m ”n”¸"”˝"‘C "‘π "‘ "‘ "‘m "‘˝ °dONLNda„HÓì(ÎHDTRemoveComment°dONLNdq„æÓ◊)v$0029°dONLNdx„#Ói)ebHasDesktopMgr"‡C"‡Dt"‡π"‡∫*"‡Â"‡Ê7"‡"‡M"‡m ‡n‡¸"‡˝"·C "·π "·Â "· "·m "·˝ °dONLNdâH˚Ñ(¯H DTGetComment°dONLNdñæ˚◊)v$002A°dONLNdù#˚i)ebHasDesktopMgr"ÌC"ÌDt"Ìπ"Ì∫*"ÌÂ"ÌÊ7"Ì"ÌM"Ìm Ìn̸"Ì˝"ÓC "Óπ "Ó "Ó "Óm "Ó˝ °dONLNdÆ˝Hk(HDTFlush°dONLNd∂˝æ◊)v$002B°dONLNdΩ˝#i)ebHasDesktopMgr°dONLNdÃ˝r€)ODo nothing (noErr) on°dONLNd‚    r‡* remote shared volumes."˙C"˙Dt"˙π"˙∫*"˙Â"˙Ê7"˙"˙M"˙m ˙n˙¸"˙˝"˚C"˚π"˚Â"˚"˚m"˚˝°dONLNd˙H!k(HDTReset°dONLNdæ!◊)v$002C°dONLNd    #!i)ebHasDesktopMgr°dONLNdr!€)ODo nothing (noErr) on°dONLNd."r-‡* remote shared volumes."C"Dt"π"∫*"Â"Ê7""M"m n¸"˝"C"π"Â""m"˝°dONLNdF/H:u(7H    DTGetInfo°dONLNdQ/æ:◊)v$002D°dONLNdX/#:i)ebHasDesktopMgr°dONLNdg/r:Ô)OReturn paramErr on remote°dONLNdÅ;rFΩ* shared volumes.",C",Dt",π",∫*",Â",Ê7",",M",m ,n,¸",˝"-C"-π"-Â"-"-m"-˝°dONLNdíHHSÑ(PH DTOpenInform°dONLNdüHæS◊)v$002E°dONLNd¶H#Si)ebHasDesktopMgr°dONLNdµHrSÂ)OThe returned ioDTRefNum°dONLNdÕTr_Í* must be a file reference°dONLNdÊ`rk€* number (a FCB must be°dONLNd¸lrwÔ* used). Return paramErr on°dONLNdxrɇ* remote shared volumes."EC"EDt"Eπ"E∫*"EÂ"EÊ7"E"EM"Em EnE¸"E˝"FC;"Fπ;"FÂ;"F;"Fm;"F˝;°dONLNd.ÖHêp(çHDTDelete°dONLNd7Öæê◊)v$002F°dONLNd>Ö#êi)ebHasDesktopMgr°dONLNdMÖrêÔ)OReturn paramErr on remote°dONLNdgërúΩ* shared volumes."ÇC"ÇDt"Çπ"Ç∫*"ÇÂ"ÇÊ7"Ç"ÇM"Çm ÇnǸ"Ç˝"ÉC"õC#"õDt"Éπ"õπ"õ∫*"ÉÂ"õÂ"õÊ7"É"õ"õM"Ém"õm õnõ¸"É˝"õ˝#
  4462. (ÚHC-) 4)$File System Routine Tableˇ2dˇ ˇˇˇˇd
  4463. d,Times
  4464. .(3ûFile System Routine Table,
  4465. Courier
  4466.     °dONLNdd`o¿(l`AppleShare Calls"a[#"a\t"a—"a“*"a˝"a˛7"a6"a7M"aÖ aÜa"a#"b[ "b— "b˝ "b6 "bÖ "b °dONLNdq`|ó*
  4467. GetVolParms°dONLNd"q÷|Ô)v$0030°dONLNd(q| ),• (see°dONLNd/}à* Note)°dONLNd6qä| (yäGetVolParms is required if°dONLNdQ}äà * you want to support any of°dONLNdlâäî* the calls that require a°dONLNdÖïä†Û* volume attribute bit."n["n\t"n—"n“*"n˝"n˛7"n6"n7M"nÖ nÜn"n"o[/"o—/"o˝/"o6/"oÖ/"o/°dONLNdú¢`≠ú(™` GetLogInInfo°dONLNd©¢÷≠Ô)v$0031°dONLNd∞¢;≠r)e bAccessCntl"ü["ü\t"ü—"ü“*"ü˝"ü˛7"ü6"ü7M"üÖ üÜü"ü"†[ "†— "†˝ "†6 "†Ö "† °dONLNdæØ`∫ú(∑` GetDirAccess°dONLNdÀØ÷∫Ô)v$0032°dONLNd“Ø;∫r)e bAccessCntl"¨["¨\t"¨—"¨“*"¨˝"¨˛7"¨6"¨7M"¨Ö ¨ܨ"¨"≠[ "≠— "≠˝ "≠6 "≠Ö "≠ °dONLNd‡º`«ú(ƒ` SetDirAccess°dONLNd̺÷«Ô)v$0033°dONLNdÙº;«r)e bAccessCntl"π["π\t"π—"π“*"π˝"π˛7"π6"π7M"πÖ πÜπ"π"∫[ "∫— "∫˝ "∫6 "∫Ö "∫ °dONLNd…`‘y(—`MapID°dONLNd    …÷‘Ô)v$0034°dONLNd…;‘r)e bAccessCntl"Δ["Δ\t"Δ—"Δ“*"Δ˝"Δ˛7"Δ6"Δ7M"ΔÖ ΔÜΔ"Δ"«[ "«— "«˝ "«6 "«Ö "« °dONLNd÷`·É(fi`MapName°dONLNd&÷÷·Ô)v$0035°dONLNd-÷;·r)e bAccessCntl"”["”\t"”—"”“*"”˝"”˛7"”6"”7M"”Ö ”Ü”"”"‘[ "‘— "‘˝ "‘6 "‘Ö "‘ °dONLNd;„`Óà(Î`CopyFile°dONLNdD„÷ÓÔ)v$0036°dONLNdK„;Ów)e bHasCopyFile"‡["‡\t"‡—"‡“*"‡˝"‡˛7"‡6"‡7M"‡Ö ‡܇"‡"·[ "·— "·˝ "·6 "·Ö "· °dONLNdZ`˚í(¯`
  4468. MoveRename°dONLNde÷˚Ô)v$0037°dONLNdl;˚Å)ebHasMoveRename"Ì["Ì\t"Ì—"Ì“*"Ì˝"Ì˛7"Ì6"Ì7M"ÌÖ ÌÜÌ"Ì"Ó[ "Ó— "Ó˝ "Ó6 "ÓÖ "Ó °dONLNd}˝`à(`OpenDeny°dONLNdÜ˝÷Ô)v$0038°dONLNdç˝;w)e bHasOpenDeny"˙["˙\t"˙—"˙“*"˙˝"˙˛7"˙6"˙7M"˙Ö ˙Ü˙"˙"˚[ "˚— "˚˝ "˚6 "˚Ö "˚ °dONLNdú
  4469. `í(`
  4470. OpenRFDeny°dONLNdß
  4471. ÷Ô)v$0039°dONLNdÆ
  4472. ;w)e bHasOpenDeny"["\t"—"“*"˝"˛7"6"7M"Ö Ü""[ "— "˝ "6 "Ö " °dONLNdΩ`"ó(` GetXCatInfo°dONLNd…÷"Ô)v$003A°dONLNd–;"|)e
  4473. bHasShortName"["\t"—"“*"˝"˛7"6"7M"Ö Ü""[ "— "˝ "6 "Ö " °dONLNd‡$`/ø(,`GetVolMountInfoSize°dONLNdÙ$÷/Ô)v$003F"!["!\t"!—"!“*"!˝"!˛7"!6"!7M"!Ö !Ü!"!""[ ""— ""˝ ""6 ""Ö "" °dONLNd˛1`<´(9`GetVolMountInfo°dONLNd1÷<Ô)v$0040".[".\t".—".“*".˝".˛7".6".7M".Ö .Ü."."/[ "/— "/˝ "/6 "/Ö "/ °dONLNd>`Ió(F` VolumeMount°dONLNd$>÷IÔ)v$0041";[";\t";—";“*";˝";˛7";6";7M";Ö ;Ü;";"<[ "<— "<˝ "<6 "<Ö "< °dONLNd.K`Vy(S`Share°dONLNd4K÷VÔ)v$0042°dONLNd<KäV)¥Handled by AppleShare or°dONLNdUWäbÓ* File Sharing server."H["H\t"H—"H“*"H˝"H˛7"H6"H7M"HÖ HÜH"H"I["I—"I˝"I6"IÖ"I°dONLNdkd`oÉ(l`UnShare°dONLNdsd÷oÔ)v$0043°dONLNd{däo)¥Handled by AppleShare or°dONLNdîpä{Ó* File Sharing server."a["a\t"a—"a“*"a˝"a˛7"a6"a7M"aÖ aÜa"a"b["b—"b˝"b6"bÖ"b°dONLNd™}`àí(Ö`
  4474. GetUGEntry°dONLNdµ}÷àÔ)v$0044°dONLNdΩ}äà)¥Handled by AppleShare or°dONLNd÷âäîÓ* File Sharing server."z["z\t"z—"z“*"z˝"z˛7"z6"z7M"zÖ zÜz"z"{["{—"{˝"{6"{Ö"{°dONLNdÏñ`°´(û`GetForeignPrivs°dONLNd¸ñ÷°Ô)v$0060"ì["ì\t"ì—"ì“*"ì˝"ì˛7"ì6"ì7M"ìÖ ìÜì"ì"î[ "î— "î˝ "î6 "îÖ "î °dONLNd£`Æ´(´`SetForeignPrivs°dONLNd£÷ÆÔ)v$0061"†["†\t"†—"†“*"†˝"†˛7"†6"†7M"†Ö †Ü†"†"°[ "≠[#"≠\t"°— "≠—"≠“*"°˝ "≠˝"≠˛7"°6 "≠6"≠7M"°Ö "≠Ö ≠Ü≠"° "≠#
  4475. (ÚoFile System Routine Table)öC-) 5ˇdˇ ˇˇˇˇd
  4476. d,     Helvetica
  4477. .°dONLNdV`h‹+`d APPENDIX D:°dONLNd Vh÷)êFILE SYSTEM MANAGER Q^Q°dONLNd l~¯*QUESTIONS AND ANSWERS ~^~,Times
  4478. (ÚD-) 1ˇ
  4479. tdˇ ˇˇˇˇd
  4480. d,Times
  4481. .+H3 Guide to the File System Manager,     Helvetica
  4482. °dONLNdUHdˆ*-ABOUT THIS APPENDIX NFN gFg
  4483. °dONLNd~Hä*'ZThis appendix contains a bunch of questions and answers gathered by Developer Support that°dONLNdoäHñ;* 5will be useful to developers of foreign file systems.
  4484. °dONLNd•ªH *3QUESTIONS AND ANSWERS ¥F¥ ÕFÕ
  4485. °dONLNdª‰T]+ 'Q°dONLNdº‰]`)    :°dONLNdæ‰f›)    MIf my foreign file system doesn’t support one of the non-required HFSDispatch°dONLNd f¸ * $select codes, what should it return?°dONLNd1T](TA°dONLNd2]`)    :°dONLNd4f‡)    QThe foreign file system should return paramErr (-50) if it doesn’t support one of°dONLNdÜf&6* *the non-required HFSDispatch select codes.°dONLNd≤DTP](MTQ°dONLNd≥D]P`)    :°dONLNdµDfPØ)    BI’m implementing the Desktop Manager calls. How big can icons get?°dONLNd¯bTn](kTA°dONLNd˘b]n`)    :°dONLNd˚bfn›)    LApple’s Desktop Manager allows icons to be up to 4500 bytes, you should too.°dONLNdIåTò](ïTQ°dONLNdJå]ò`)    :°dONLNdLåfò≈)    IWhat fields in an FCBRec can be used by a foreign file system for its own°dONLNdñòf§ñ*     purposes?°dONLNd†∂T¬](øTA°dONLNd°∂]¬`)    :°dONLNd£∂f¬‰)    PSee Chapter 3, The File System Utility Routines, of the Guide to the File System°dONLNdÙ¬fŒÈ* SManager. It tells what fields can be used by your foreign file system and tells how°dONLNdHŒf⁄:* -those fields are used by the HFS file system.°dONLNdw¯T](TQ°dONLNdx¯]`)    :°dONLNdz¯f„)    JWhat are the catalog node ID (CNID) numbers below fsUsrCNID (16) used for?°dONLNd≈T"](TA°dONLNdΔ]"`)    :°dONLNd»f"„)    OCNID 1 is reserved for the parent ID of the root directory (fsRtParID) and CNID°dONLNd"f.Õ* M2 is reserved for the directory ID of the root directory (fsRtDirID).  On HFS°dONLNdf.f:Â* Vvolumes, 3 is used for the extents file, 4 is used for the catalog file, and 5 is used°dONLNdΩ:fFΔ* Kfor the bad allocation block file. Your foreign file system can use CNIDs 5°dONLNd    FfR2* *through 15 for whatever purposes it needs.°dONLNd5^fj“*KWhen _UnmountVol is called, the File Manager checks to see if there are any°dONLNdÅjfv¬* Gopen files on that volume with a file number (fcbFlNm in the FCBRec) of°dONLNd…vfÇfl* LfsUsrCNID or greater.  If so, the File Manager does not pass the _UnmountVol°dONLNdÇféÃ* Mrequest on to the file system that owns the volume and a result of fBsyErr is°dONLNddéfö·* Oreturned to the caller. You can use CNIDs 5 through 15 for files opened by your°dONLNd¥öf¶⁄* Lforeign file system that should not prevent _UnmountVol from succeeding (for°dONLNd¶f≤Δ* Eexample, you should use a CNID below fsUsrCNID for the file number in°dONLNdG≤fæÁ* IFCBRecs used for the Desktop Manager DTGetPath or DTOpenInform routines).(ÚHD-) 2)$Questions and Answersˇºdˇ ˇˇˇˇd
  4486. d,Times
  4487. .(3´Questions and Answers°dONLNdUlau(^lQ°dONLNdUuax)    :°dONLNdU~a⁄)    GWhat are the advantages of supporting the Desktop Manager select codes?°dONLNdKslu(|lA°dONLNdLsux)    :°dONLNdNs~˝)    QIf you don’t support the Desktop Manager select codes, the Finder will attempt to°dONLNd†~ãŸ* Jcreate a Desktop file to keep track of application mappings and icons. The°dONLNdÎã~óü* <advantages of the Desktop Manager over the Desktop file are:°dONLNd(©Ñµà+•°dONLNd*©ñµÊ)FThere is a documented interface for the Desktop Manager functions that°dONLNdqµñ¡Û* developers can use.°dONLNdÖ”Ñflà(‹Ñ•°dONLNdá”ñflÌ)DThe Desktop Manager can be used on shared volumes. The Desktop file,°dONLNdÃflñΈ* Nsince it is simply a resource file, can only allow write access to one user or°dONLNdÎñ˜Ò* Jprocess - it cannot be shared. Under System 7, that process is the Finder.°dONLNdf    Ñà(Ñ•°dONLNdh    ñ‰)DThe Desktop Manager functions can be implemented by an external file°dONLNd≠ñ!Ê* Jsystem in the most efficient way possible for that particular file system.°dONLNd¯3Ñ?à(<Ñ•°dONLNd˙3ñ?Ù)IThe Desktop Manager doesn't have the file size limitations imposed by the°dONLNdD?ñKÌ* CResource Manager; 2727 resources and approximately 16Mb of resource°dONLNdàKñW≠* data.°dONLNdèulÅu(~lQ°dONLNdêuuÅx)    :°dONLNdíu~ň)    KHow does information get removed from the Desktop file or Desktop Database?°dONLNdfiìlüu(úlA°dONLNdflìuüx)    :°dONLNd·ì~üÓ)    MWith both the Desktop file and the Desktop Manager database, icon data is not°dONLNd/ü~´È* Mremoved from the database unless the Desktop database or file is rebuilt from°dONLNd}´~∑¸* Rscratch. That's because the Finder (and file system for that matter) has no way of°dONLNd–∑~√Î* Obeing notified when the last file of a given creator and type is removed from a°dONLNd √~œÔ* Nvolume. If the Finder removes an application (a file with type APPL), then the°dONLNdoœ~€Ú* NFinder attempts to remove the application mapping information for that copy of°dONLNdæ€~Áe* 2the application from the Desktop database or file.°dONLNdÚlu(lQ°dONLNdÛux)    :°dONLNdı~¯)    LWe want to provide the shared desktop database environment. What minimal set°dONLNdB~6* (of calls do we need to support for this?°dONLNdk/l;u(8lA°dONLNdl/u;x)    :°dONLNdn/~;˙)    PIt really depends on how your file system is going to be used. Apple's read-only°dONLNdø;~G˛* Qforeign file systems such as ISO 9660 let you open the desktop database, get info°dONLNdG~SÚ* Ron it (all zeros are returned), and get comments on the root directory.  All other°dONLNddS~_Ú* NDesktop Manager routines return an error.  Apple's two read/write file systems°dONLNd≥_~k¯* Mthat support the Desktop Manager, AppleShare and HFS, both support all of the°dONLNdk~wˆ* Moriginal Desktop Manager calls (selectors $20 through $2A).  HFS supports the°dONLNdOw~ɡ* Iselectors $2B through $2F; DTFlush, DTReset, DTGetInfo, DTOpenInform, and°dONLNdôÉ~èÏ* KDTDelete don't make sense in a shared environment.  So, I'd say you need to°dONLNdÂè~õÓ* Nsupport selectors $20 through $2A and then return an appropriate error for the°dONLNd    4õ~ß* Mothers. AppleShare returns noErr and does nothing for DTFlush and DTReset and°dONLNd    Çß~≥±* ;returns paramErr for DTGetInfo, DTOpenInform, and DTDelete.+˛BQuestions and Answers)çD-) 3ˇdˇ ˇˇˇˇd
  4488. d,Times
  4489. .+H3 Guide to the File System Manager°dONLNdUTa]+ +Q°dONLNdU]a`)    :°dONLNdUfa‹)    LWe do not necessarily want full AppleShare (AFP) access-control, but we need°dONLNdPafmS* 2more information on foreign file privilege models.°dONLNdÉTã](àTA°dONLNdÑ]ã`)    :°dONLNdÜfã‰)    MTo be compatible with existing Macintosh applications, you must mimic the HFS°dONLNd‘ãfóµ* Efile system's permission model. Inside Macintosh: Files describes how°dONLNdóf£Õ* IAppleShare does that on pages 2-17 and 2-18. If you want a more extensive°dONLNdd£fØË* Ppermission model that AppleShare-aware applications can use, then you'll need to°dONLNdµØfª≤* Asupport the AppleShare HFSDispatch selectors and mimic AppleShare°dONLNd˜ªf«Ÿ* Mpermissions. If you can't fit into the AppleShare model, you can come up with°dONLNdE«f”ª* Ayour own model and use PBGetForeignPrivs and PBSetForeignPrivs to°dONLNdá”ffl‡* Omanipulate your native privileges. However, you still must map those privileges°dONLNd◊flfÎ…* Hto the HFS file system model. If you decide to use PBGetForeignPrivs and°dONLNd Îf˜À* LPBSetForeignPrivs, you'll use the creator type assigned to your foreign file°dONLNdm˜f±* Asystem for your vMForeignPrivID number (the number you return for°dONLNdØf* PBHGetVolParms requests).°dONLNd -T9](6TQ°dONLNdÀ-]9`)    :°dONLNdÕ-f9ú)    @What is needed for a foreign file system to support PBCatSearch?°dONLNdKTW](TTA°dONLNdK]W`)    :°dONLNdKfW≈)    GYou'll need to support PBHGetVolParms so that you can indicate that you°dONLNdYWfcË* Ssupport CatSearch. It will be up to your foreign file system to come up with a fast°dONLNd≠cfo–* Iway to search a volume’s catalog for matches. The Apple Developer Support°dONLNd˜of{Â* Osample code MoreFiles version 1.2 and later contains much of the code needed to°dONLNdG{fá,* )implement CatSearch in the file Search.C.°dONLNdr•T±](ÆTQ°dONLNds•]±`)    :°dONLNdu•f±Á)    KFindFolder seems to make some assumption on volumes that support AppleShare°dONLNd¡±fΩQ* 0(AFP) access-control. What are those assuptions?°dONLNdÚœT€](ÿTA°dONLNdÛœ]€`)    :°dONLNdıœf€fi)    PThe folder manager assumes that user ID 0 is the guest user and user ID 1 is the°dONLNdF€fÁ⁄* Oadministrator (owner) user and uses byte range locks on an empty data file as a°dONLNdñÁfÛfl* Osemaphore to control access to individual trash folders on the volume. For more°dONLNdÊÛfˇ * Jinformation, see Inside AppleTalk, second edition and the AppleTalk Filing°dONLNd1ˇf ´* CProtocol Version 2.1 chapter of the AppleShare 3.0 Developer’s Kit.°dONLNdv)T5](2TQ°dONLNdw)]5`)    :°dONLNdy)f5@)    )How should I handle VolumeMount requests?°dONLNd£GTS](PTA°dONLNd§G]S`)    :°dONLNd¶GfS◊)    JVolumeMount requests are caught by the File System Manager before they are°dONLNdÒSf_¡* Jpassed to the File Manager. FSM calls each installed foreign file system’s°dONLNd<_fk÷* HfileSystemCommProc with a ffsIDVolMountMessage. If the media type is not°dONLNdÖkfw›* Pyour foreign file system’s media type, you return extFSErr. If the media type is°dONLNd÷wfÉÊ* Nyour foreign file system’s media type, you return noErr and the your HFSCIProc°dONLNd    %ÉfèN* 0will be called with the VolumeMount select code.°dONLNd    WõfßË*LWhen your HFSCIProc is called with the VolumeMount select code, your foreign°dONLNd    §ßf≥≥* Efile system should do everything needed to mount a volume. It should:(ÚHD-) 4)$Questions and Answersˇ ∏dˇ ˇˇˇˇd
  4490. d,Times
  4491. .(3´Questions and Answers°dONLNdaÑmà(jÑ•°dONLNdañmˆ)DAllocate memory for a volume control block (VCB) with UTAllocateVCB.°dONLNdGÑãà(àÑ•°dONLNdIñã)Fill in the fields of the VCB.°dONLNdhùÑ©à(¶Ñ•°dONLNdjùñ©Ì)FAllocate memory for a drive queue element (DrvQEl) in the system heap.°dONLNd±ªÑ«à(ƒÑ•°dONLNd≥ªñ«))!Fill in the fields of the DrvQEl.°dONLNd’ŸÑÂà(‚Ñ•°dONLNd◊ŸñÂÀ)>Call _AddDrive to add the DrvQEl to the drive queue (DrvQHdr).°dONLNd˜Ñà(Ñ•°dONLNd˜ñ›)8Add the VCB to the VCB queue (VCBQHdr) with UTAddNewVCB.°dONLNdQÑ!à(Ñ•°dONLNdSñ!i),Use PostEvent to post a diskInsertEvt event.°dONLNdÅ3~?(<~MThe volume reference number you return to VolumeMount is the volume reference°dONLNdœ?~K5* number returned by UTAddNewVCB.°dONLNdW~c·*JAfter VolumeMount returns to the caller, the Event Manager will handle the°dONLNd;c~o‚* KdiskInsertEvt event and will call your foreign file system with a _MountVol°dONLNdáo~{ˇ* Nrequest. Since the volume is already mounted, your MountVol code only needs to°dONLNd÷{~áº*
  4492. return noErr.°dONLNd•l±u(ÆlQ°dONLNdÊ•u±x)    :°dONLNdË•~±˝)    QCan I put up an additional user authentication dialog when my foreign file system°dONLNd:±~Ω
  4493. * gets a VolumeMount request?°dONLNdVœl€u(ÿlA°dONLNdWœu€x)    :°dONLNdYœ~€¯)    PYou put up an additional user authentication dialog if the caller of VolumeMount°dONLNd™€~Á* Ytells you it is safe to do that. To allow foreign file system to determine if it is safe,°dONLNdÁ~Û˘* MApple has extended the VolMountInfoHeader record to include a flags word (the°dONLNdRÛ~ˇÿ* Fsame flags word already in the AFPVolMountInfo record). By setting the°dONLNdôˇ~ ˚* UvolMountInteractBit (bit 15) in the flags word, the caller can tell your foreign file°dONLNdÔ ~Â* Nsystem that it is safe to use the Dialog Manager to put up your authentication°dONLNd>~#ˇ* Sdialog. In addition, if your foreign file system finds that the VolMountInfo record°dONLNdí#~/˘* Ppassed is usable but needs to be updated, it can set the volMountChangedBit (bit°dONLNd„/~;Ï* Q14) in the flags word to tell the caller that it needs to update the VolMountInfo°dONLNd5;~GÛ* Grecord using the PBGetVolMountInfoSize and PBGetVolMountInfo functions.°dONLNd~S~_’*HThe Alias Manager has been updated to set the volMountInteractBit if the°dONLNd«_~kı* NkARMNoUI rule is passed to the MatchAlias function, and to return the state of°dONLNdk~wŸ* Ethe volMountChangedBit in the needsUpdate parameter of the MatchAlias°dONLNd\w~ɪ* @function and the wasChanged parameter the ResolveAlias function.°dONLNdûè~õ§*>Here are the new constant definitions and data types you need:+˛ZQuestions and Answers)çD-) 5ˇ "dˇ ˇˇˇˇd
  4494. d,Times
  4495. .+H3 Guide to the File System Manager,
  4496. Courier
  4497. °dONLNdiru2+*? /* The new volume mount flags */°dONLNd!urÅñ* enum {°dONLNd)ÅÜç+ volMountInteractBit = 15,°dONLNdCÅDçÊ)æ/* Input to VolumeMount: If°dONLNddçVôÏ+ set, it's OK for the file°dONLNdÉôV•⁄* system to perform user°dONLNdü•V±Ê* interaction to mount the°dONLNdΩ±VΩå*     volume */°dONLNd»ΩÜ…:(ΔÜvolMountInteractMask = 0x8000,°dONLNdÈ’Ü·*volMountChangedBit = 14,°dONLNd’D·Ú)æ/* Output from VoumeMount: If°dONLNd%·VÌ˛+ set, the volume was mounted,°dONLNdGÌV˘‡* but the volume mounting°dONLNdd˘V¯* information record needs to°dONLNdÖV™* be updated. */°dONLNdïÜ4(ÜvolMountChangedMask = 0x4000,°dONLNdµ)Ü5Ù*=volMountFSReservedMask = 0x00ff, /* bits 0-7 are defined each°dONLNd¯5VAŒ+– file system's use */°dONLNdAÜM˙(JÜ>volMountSysReservedMask = 0xff00 /* bits 8-15 are reserved for°dONLNdRMVY»+– Apple system use */°dONLNdfYre~(br};°dONLNdjqr}V*&/* The new volume mount info record */°dONLNdë}râ* struct VolMountInfoHeader {°dONLNdÆâÜï§+ short°dONLNd¥âÿï)Rlength;°dONLNdºâDï‡)l/* length of location data°dONLNd‹ïV°»+ (including self) */°dONLNdÒ°Ü≠¬(™Ü
  4498. VolumeType°dONLNd¸°ÿ≠¸)Rmedia;°dONLNd°D≠Ê)l/* type of media.  Variable°dONLNd$≠Vπ⁄+ length data follows */°dONLNd<πÜ≈§(¬Üshort°dONLNdBπÿ≈¸)Rflags;°dONLNdIπD≈Ü)l /* flags */°dONLNdU≈r—~(Œr};°dONLNdX—r›∞* 5typedef struct VolMountInfoHeader VolMountInfoHeader;°dONLNdé›rÈz* ,typedef VolMountInfoHeader *VolMountInfoPtr;
  4499. °dONLNdªT](TQ°dONLNdº]`)    :°dONLNdæfŸ)    PWhat is the correct time to put up an additional user authentication dialog when°dONLNdf*_* 2my foreign file system gets a VolumeMount request?°dONLNdB<TH](ETA°dONLNdC<]H`)    :°dONLNdE<fH⁄)    PThe correct time to put up an additional user authentication dialog is when your°dONLNdñHfTÈ* Kforeign file system’s fileSystemCommProc gets the ffsIDVolMountMessage. You°dONLNd‚Tf`‚* Qdon’t want to wait until your HFSCIProc is called because at that time, you’re in°dONLNd4`fl“* Lthe middle of a File Manager request and cannot do anything that might cause°dONLNdÅlfxÛ* another File Manager request.(ÚHD-) 6)$Questions and Answersˇ
  4500. údˇ ˇˇˇˇd
  4501. d,Times
  4502. .(3´Questions and Answers°dONLNdalmu(jlQ°dONLNdaumx)    :°dONLNda~m„)    HHow do I register a VolumeMount media type?  How do I register a foreign°dONLNdLm~yÁ* privileges ID number?°dONLNdbãlóu(îlA°dONLNdcãuóx)    :°dONLNdeã~óÛ)    LUse your file system ID number for your foreign privileges ID number and use°dONLNd≤ó~£ÿ* Kthe creator type that you registered for your file system ID number for the°dONLNd˛£~Ø* GVolumMount media type. If for some reason, you need another VolumeMount°dONLNdFØ~ª˜* Pmedia type or foreign privileges ID number, you can simply register another file°dONLNdóª~«¸* Nsystem ID number. It will be up to you to document your file system ID number,°dONLNdÊ«~”’* Dforeign privileges ID number, and VolumeMount media type if you want°dONLNd+”~flÙ* Ldevelopers to know about them. That’s keeping with Apple’s policy of keeping°dONLNdxfl~ÎÍ* Kcreator types, card ID numbers, ADEV ID numbers, etc. confidential.  If you°dONLNdƒÎ~˜Û* Odecide to publish information specific to your file system, you should probably°dONLNd˜~Ô* Kinclude header files for programmers and that’s where you can document your°dONLNd`~´* numbers.°dONLNdj-l9u(6lQ°dONLNdk-u9x)    :°dONLNdm-~9˘)    QWhere are the constants for the new information I can get by calling Gestalt with°dONLNdø9~E˘* the gestaltFSAttr selector?°dONLNd€Wlcu(`lA°dONLNd‹Wucx)    :°dONLNdfiW~c≤)     Right here:,
  4503. Courier
  4504. °dONLNdÎ~ää+ 'gestaltFSAttr = 'fs  ',°dONLNd~\ä)“/* file system attributes */°dONLNd!ñä¢J(üä gestaltFullExtFSDispatching = 0,°dONLNdBñ\¢)“/* all HFSDispatch selectors°dONLNdd¢nÆ
  4505. + are passed through to file°dONLNdÑÆn∫™*
  4506. systems */°dONLNdè∫äΔ&(√ägestaltHasFSSpecCalls = 1,°dONLNd™∫\Δ¯)“/* File Manager has FSSpec°dONLNd Δn“û+ calls */°dONLNd”“äfiJ(€ä gestaltHasFileSystemManager = 2,°dONLNdÙ“\fi‡)“/* has the File System°dONLNdfinÍ™+
  4507. Manager */°dONLNdÍäˆ>(ÛägestaltFSMDoesDynamicLoad = 3,°dONLNd:Í\ˆ)“/* File System Manager supports°dONLNd_ˆn⁄+ dynamic loading */°dONLNdrä8( ägestaltFSSupports4GBVols = 4,°dONLNdê\Ê)“/* file system supports°dONLNd≠nÏ+ 4 gigabyte volumes */°dONLNd√ä&8(#ägestaltFSSupports2TBVols = 5,°dONLNd·\&Ê)“/* file system supports°dONLNd˛&n2Ï+ 2 terabyte volumes */°dONLNd2ä>D(;ägestaltHasExtendedDiskInit = 6,°dONLNd42\>‘)“/* has extended Disk°dONLNdN>nJ¯+ Initialization calls */
  4508. °dONLNdfslu(|lQ°dONLNdgsux)    :°dONLNdis~Á)    HWhat should I return when called with the GetVolParms HFSDispatch select°dONLNd≤~ãô* code?°dONLNd∏ùl©u(¶lA°dONLNdπùu©x)    :°dONLNdªù~©)    MFunny you should ask.  Here’s how GetVolParms looks from the file system side°dONLNd    ©~µ´*
  4509. of things:+˛@Questions and Answers)çD-) 7ˇ
  4510. Ódˇ ˇˇˇˇd
  4511. d,Times
  4512. .+H3 Guide to the File System Manager°dONLNdaHmÎ*7OThe GetVolParmsInfoBuffer Record from file systems implementing PBHGetVolParms:°dONLNdPÖTëw+ $Offset°dONLNdWÖ~ëõ)*Field°dONLNd]ÖëL)ûMeaning°dONLNdeùT©Z(¶T0°dONLNdgù~©≥)*    vMVersion°dONLNdqù©¸)û+Version number of the GetVolParmsInfoBuffer°dONLNd†©µ˙* /record you return.  Version 1 indicates you can°dONLNd”µ¡Ì* (return the vMVersion through vMServerAdr°dONLNdˇ¡ÕÚ* /fields.  Version 2 indicates you can return the°dONLNd2ÕŸÚ* )vMVersion through vMForeignPrivID fields.°dONLNd`ŸÂ* -Note: You must return no more than ioReqCount°dONLNdëÂÒ* /bytes to PBHGetVolParms requests.  Indicate the°dONLNdƒÒ˝˙* .actual number of bytes returned in ioActCount.°dONLNdÛ˝T    Z(T2°dONLNdı˝~    ©)*vMAttrib°dONLNd˛˝    )û0A 32-bit quantity that encodes information about°dONLNd2    Ç* the volume attributes.°dONLNdIT!Z(T6°dONLNdK~!¬)* vMLocalHand°dONLNdW!˘)û1If supplied, a handle to private data kept by the°dONLNdå!-* .Macintosh system for shared volumes while they°dONLNdæ-9* ,are mounted.  When you mount the volume, you°dONLNdÓ9E * 2must allocate a handle to a 2-byte block of memory°dONLNd$EQ‘* 'in the system heap which is returned in°dONLNdOQ]* *vMLocalHand.  When you unmount the volume,°dONLNd}]i* 2dispose of the handle.  Set the bLocalWList bit in°dONLNd≥iu * 8the vMAttrib field to indicate that this field is valid.°dONLNduÅ* /See the description of bLocalWList for when you°dONLNd#Åçñ* should supply the handle.°dONLNd=çTô`(ñT10°dONLNd@ç~ôø)* vMServerAdr°dONLNdLçôı)û0For file server volumes, this field contains the°dONLNdÄô•˛* 2AppleTalk internet address of the file server that°dONLNd∂•±* /manages the volume.  An application can inspect°dONLNdÈ±Ω‰* ,this field to tell which volumes belong to a°dONLNdΩ…* 7particular file server; the value of this field is 0 if°dONLNdT…’ * 4the volume does not belong to a file server.  If you°dONLNdå’·¯* -support PBHCopyFile, you must initialize this°dONLNdΩ·Ì5* field.°dONLNdΔÌ˘    * 3The Finder uses this field to determine if a volume°dONLNd˝˘·* 'is a network volume (non-zero = network°dONLNd(Ï* *volume). If you have a network volume that°dONLNdVˇ* .doesn’t have an AppleTalk address, you need to°dONLNdà)Ò* /use something that isn't zero and isn't a valid°dONLNdª)5Â* *AppleTalk address - I suggest that you use°dONLNdÈ5AÚ* 2$ffffffff (-1);  $ffffffff is an illegal AppleTalk°dONLNdAM›* *address so it won’t ever be used as a real°dONLNdMMYx* AppleTalk address.°dONLNd`YTe`(bT14°dONLNdcY~e–)*
  4513. vMVolumeGrade°dONLNdqYe    )û3The relative speed rating of the volume.  The scale°dONLNd®eq„* +used to determine these values is currently°dONLNd◊q}˘* 2uncalibrated, so until further notice, return 0 in°dONLNd
  4514. }âI* this field.(ÚHD-) 8)$Questions and Answersˇ6dˇ ˇˇˇˇd
  4515. d,Times
  4516. .(3´Questions and Answers°dONLNdUlax(^l18°dONLNdUñaÎ)*vMForeignPrivID°dONLNdU4a)û+The access privilege model supported by the°dONLNdBa4m * 2volume.  Currently two values are defined for this°dONLNdxm4y* .field: 0 represents a standard HFS volume that°dONLNd™y4Ö    * ,might or might not support the AFP privilege°dONLNd⁄Ö4ë* *model; fsUnixPriv represents a volume that°dONLNdë4ù"* /supports the A/UX privilege model.  I recommend°dONLNd;ù4©"* 2that you use 0 and try to map your privilege model°dONLNdq©4µˆ* &to the AFP privilege model for maximum°dONLNdõµ4¡¸* *compatibility with Macintosh applications.°dONLNdΔÕ`Ÿ«(÷`FThe vMAttrib Field Bits from file systems implementing PBHGetVolParms:°dONLNd
  4517. Òl˝}+ $Bit°dONLNdÒñ˝∂)*Name°dONLNdÒ4˝d)ûMeaning°dONLNd    lx(l31°dONLNd!    ñ—)*
  4518. bLimitFCBs°dONLNd,    4 )û,The volume supports a small finite number of°dONLNd\4! * 7open files.  Set this bit to indicate that applications°dONLNdó!4-* 0should attempt to limit the number of files they°dONLNdÀ-49* +keep open on this volume.  For example, the°dONLNd˙94E
  4519. * /Finder limits the number of file control blocks°dONLNd-E4Q"* 5used during copying to 8 instead of 16 if this bit is°dONLNdfQ4]E* set.°dONLNdk]lix(fl30°dONLNdn]ñi”)* bLocalWList°dONLNdz]4i)û3Set this bit to indicate that the vMLocalHand field°dONLNd±i4u* 0of the GetVolParmsInfoBuffer record is valid and°dONLNdÂu4Å* 0the Finder’s open window list information is not°dONLNdÅ4ç#* 1stored on this volume.  Shared volumes should set°dONLNdNç4ôX*     this bit.°dONLNdXôl•x(¢l29°dONLNd[ôñ•ÿ)* bNoMiniFndr°dONLNdgô4•∞)ûReserved; always set to 1.°dONLNdÇ•l±x(Æl28°dONLNdÖ•ñ±œ)*    bNoVNEdit°dONLNdè•4±¸)û(This volume’s name cannot be edited. The°dONLNdª±4Ω* -System 7 Finder ignores this bit and looks at°dONLNdÏΩ4…Ê* $bAccessCntl instead for some reason.°dONLNd…l’x(“l27°dONLNd…ñ’“)*
  4520. bNoLclSync°dONLNd…4’)û3Set this bit to indicate that modification dates on°dONLNdV’4·* /this volume can change with no action from this°dONLNdâ·4Ìˇ* (system.  For example, a network volume’s°dONLNdµÌ4˘≈* modification dates can change.°dONLNd‘˘lx(l26°dONLNd◊˘ñ◊)* bTrshOffLine°dONLNd‰˘4)û2Set this bit to indicate that this volume does not°dONLNd4* 1support an offline state.  The PBOffLine function°dONLNdO4* /is not supported by this volume.  If the Finder°dONLNdÇ4)#* 4finds this volume offline, it is zoomed to the Trash°dONLNd∫)45Å* and unmounted.°dONLNd…5lAx(>l25°dONLNdÃ5ñAŸ)* bNoSwitchTo°dONLNdÿ54A)û/Obsolete.  The Finder will not switch launch to°dONLNd A4M»* any application on this volume.°dONLNd+MlYä(Vl24–21°dONLNd2M4Y†)»Reserved.  Set to zero.°dONLNdJYlex(bl20°dONLNdMYñe›)* bNoDeskItems°dONLNdZY4e)û2Set this bit to indicate that this volume does not°dONLNdêe4q"* 2support objects on the desktop.If the volume has a°dONLNdΔq4}#* 3folder named Desktop Folder in it’s root directory,°dONLNd˝}4â‘* %it is treated as any other directory.°dONLNd#âlïx(íl19°dONLNd&âñïÿ)* bNoBootBlks°dONLNd2â4ï )û2Set this bit to indicate that this volume is not a°dONLNdhï4°˜* (startup volume. The Startup menu item is°dONLNdî°4≠* 0disabled. Boot blocks are not copied during copy°dONLNd»≠4πi* operations.+H<Questions and Answers)çD-) 9ˇŒdˇ ˇˇˇˇd
  4521. d,Times
  4522. .+H3 Guide to the File System Manager°dONLNdUTa`+ +18°dONLNdU~aπ)* bAccessCntl°dONLNdUa˚)û2Set this bit to indicate that this volume supports°dONLNdEamı* ,AppleTalk AFP access-control interfaces. The°dONLNdumyŸ* !PBHGetLoginInfo, PBHGetDirAccess,°dONLNdöyÖÀ* PBHSetDirAccess, PBHMapID, and°dONLNdºÖë* +PBHMapName functions are supported. Special°dONLNdÎëùÌ* ,folder icons are used. The Access Privileges°dONLNdù©˚* -(System 6) or Sharing (System 7) menu item is°dONLNdL©µ* 0enabled for disk and folder items.  The ioACUser°dONLNdĵ¡Ò* -field returned by PBGetCatInfo for folders is°dONLNd±¡Õ›* 'assumed to be valid. Note: volumes with°dONLNd‹ÕŸÏ* 'bAccessCntl and vMServerAdr=0 cannot be°dONLNdŸÂÍ* (unmounted by the Finder and volumes with°dONLNd3ÂÒ∂* bAccessCntl cannot be renamed.°dONLNdRÒT˝`(˙T17°dONLNdUÒ~˝¥)*    bNoSysDir°dONLNd_Ò˝)û/This volume doesn’t support a system directory.°dONLNdí˝    * 0Do not switch launch to this volume.  The system°dONLNdΔ    ˙* 0directory location is not stored in ioVFndrInfo.°dONLNd˜T!`(T16°dONLNd˙~!Δ)* bHasExtFSVol°dONLNd!)û2The bit name isn’t accurate. What this bit says is°dONLNd=!-›* +that the Disk Initialization Manager is not°dONLNdl-9Ï* +supported by this volume’s file system. The°dONLNdõ9E¸* 0Finder disables Erase Disk item when this bit is°dONLNdœEQ-* set.°dONLNd‘QT]`(ZT15°dONLNd◊Q~]…)* bHasOpenDeny°dONLNd‰Q]ı)û(This volume supports the PBHOpenDeny and°dONLNd]i®* PBHOpenRFDeny functions.°dONLNd)iTu`(rT14°dONLNd,i~u√)* bHasCopyFile°dONLNd9iu    )û.This volume supports the PBHCopyFile function,°dONLNdkuÅ* 1which is used in copy and duplicate operations if°dONLNd†ÅçÚ* ,both source and destination volumes have the°dONLNd–çôœ* #same server address in vMServerAdr.°dONLNdÙôT•`(¢T13°dONLNd˜ô~•ÿ)*bHasMoveRename°dONLNdô•)û&This volume supports the PBHMoveRename°dONLNd0•±G*     function.°dONLNd:±TΩ`(∫T12°dONLNd=±~Ω“)*bHasDesktopMgr°dONLNdL±ΩÍ)û(This volume supports the Desktop Manager°dONLNdxΩ…Ì* ,functions (described in the chapter “Desktop°dONLNd®…’˝* ,Manager” in Inside Macintosh: More Macintosh°dONLNdÿ’·L*     Toolbox).°dONLNd‚·TÌ`(ÍT11°dONLNd·~ÌÕ)*
  4523. bHasShortName°dONLNdÛ·Ì)û-This volume supports AFP short names with the°dONLNd$Ì˘ˇ* .GetXCatInfo select code ($3A). Once again, the°dONLNdV˘¶* bit name isn’t really accurate.°dONLNdvT`(T10°dONLNdy~Œ)*bHasFolderLock°dONLNdà‡)û$This volume supports PBHSetFLock and°dONLNd∞ * /PBHRstFLock on folders.  A locked folder cannot°dONLNd„)á* be deleted or renamed.°dONLNd˙)T5Z(2T9°dONLNd¸)~5)*bHasPersonalAccessPrivileges°dONLNd)5Ê)û+This volume has local file sharing enabled.°dONLNdE5TAZ(>T8°dONLNdG5~Afl)*bHasUserGroupList°dONLNdY5AÚ)û0The user and group list of the local file server°dONLNdçAM* /returned by the PBGetUGEntry function are valid°dONLNd¿MYh* for this volume.°dONLNd—YTeZ(bT7°dONLNd”Y~e«)*
  4524. bHasCatSearch°dONLNd·Ye)û.This volume supports the PBCatSearch function.°dONLNdeTqZ(nT6°dONLNde~q∫)* bHasFileIDs°dONLNdeq„)û*This volume supports the file ID reference°dONLNdLq}„* (functions, including the PBExchangeFiles°dONLNdx}âG*     function.°dONLNdÇâTïZ(íT5°dONLNdÑâ~ïƒ)* bHasBtreeMgr°dONLNdëâïµ)û Reserved for internal Apple use.°dONLNd≤ïT°Z(ûT4°dONLNd¥ï~°)*bHasBlankAccessPrivileges°dONLNdŒï°È)û)This volume supports inherited AFP access°dONLNd˚°≠É* privileges for folders.°dONLNd    ≠Tπf(∂T3–0°dONLNd    ≠π¢)»Reserved.  Set them to zero.(ÚHD-) 10)$Questions and AnswersˇÏdˇ ˇˇˇˇd
  4525. d,Times
  4526. .(3´Questions and Answers°dONLNdUlau(^lQ°dONLNdUuax)    :°dONLNdU~a˛)    OCan I write a native Power PC foreign file system with the File System Manager?°dONLNdSslu(|lA°dONLNdTsux)    :°dONLNdVs~)    MWe do not recommend writing File System Manager-based foreign file systems in°dONLNd§~ãÔ* Gnative Power PC code because there would be a minimum of two mixed mode°dONLNdÏã~ó˘* Oswitches per file system request you handle (you’ll be called from emulated 68K°dONLNd<ó~£Í* Mcode). Complex file system requests that cause multiple driver requests could°dONLNdä£~Ø* Ncause many more mixed mode switches. If you think of a place where native code°dONLNdŸØ~ª˜* Pwould really help the performance of your file system, you’d be best off putting°dONLNd*ª~«* Ojust that code in a Power PC accelerated code resource and calling it from your°dONLNdz«~”Î* Kforeign file system (which would still be mostly in 68K code) only when you°dONLNdΔ”~fl°* need it.(Ú|Questions and Answers)áD-) 11ˇ